Making a Discord Bot in Python (Part 1: Setup)

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 ธ.ค. 2024

ความคิดเห็น • 202

  • @abaldpersonlookingatthesky1605
    @abaldpersonlookingatthesky1605 2 ปีที่แล้ว +136

    I remember watching your videos when I got into python and coding and decided to make a discord bot as a first project, lovely to see you still at it keep it up my guy!

    • @wuaht
      @wuaht 2 ปีที่แล้ว +6

      a fool moon night

    • @williamcalhoun7841
      @williamcalhoun7841 2 ปีที่แล้ว +2

      this comment is my life currently! wish me luck. :-p

    • @iuri3930
      @iuri3930 2 ปีที่แล้ว

      @@williamcalhoun7841 same lol

    • @shirfix
      @shirfix 2 ปีที่แล้ว

      @@williamcalhoun7841 Lmao it's same

    • @ankeet404
      @ankeet404 2 ปีที่แล้ว +1

      Im the 100th liker!

  • @anon8723
    @anon8723 2 ปีที่แล้ว +41

    If you are getting an error such as:
    File env\Scripts\Activate.ps1 cannot be loaded because running scripts is disabled on this system
    At the begging of this tutorial when setting up the bot in Virtual Studio Code, below is a tutorial on how to fix the error.
    Tutorial on how to fix: th-cam.com/video/X7mg3pJfhZQ/w-d-xo.html
    The instuctions from that tutorial are listed below.
    There is an easy work around but you have to have Administrator access on the account that you are using on your PC.
    -Open PowerShell as Administrator
    -Type the command "Get-ExecutionPolicy -List"
    This will bring up a list of execution policies and their current status, at the very bottom of the list, it may say undefined or restricted
    -Type the command "Set-ExecutionPolicy Unrestricted"
    A popup will open asking if you would like to continue in powershell
    -Type "Y" to continue
    -Type the command "Get-ExecutionPolicy -List"
    This will show the new set of execution policies and their current status.
    Here is the YT video I followed for this error, the same YT video linked above: th-cam.com/video/X7mg3pJfhZQ/w-d-xo.html

  • @keno7166
    @keno7166 2 ปีที่แล้ว +10

    for anyone having trouble in the terminal and it not working, try to select the cmd terminal instead of powershell by clicking on the drop down arrow next to "powershell" on the right and select command prompt. hope this works for you!

  • @lyingpancake95
    @lyingpancake95 2 ปีที่แล้ว +3

    It's like a new season! Looking forward to this!

  • @sntx_8250
    @sntx_8250 2 ปีที่แล้ว +6

    Great!
    I just started rewriting my Bot with Hikari (+ lightbulb, but also want to try tanjun).
    Will definitely be following this series.

  • @whitehorsept
    @whitehorsept 2 ปีที่แล้ว +13

    NOTE: If "python" is not a recognised command (even though you downloaded/installed python), you need to go to your "control panel > system > advanced system settings > environment variables " and edit the "Path" variable to also include the folder where you installed python (that contains the python executable).

    • @nap_yuu
      @nap_yuu 2 ปีที่แล้ว +1

      thank you so much, i was struggling with this one!!

    • @Spiderfffun
      @Spiderfffun 2 ปีที่แล้ว +1

      or just redo the installer with add to path enabled

    • @leluch1616
      @leluch1616 2 ปีที่แล้ว +2

      thank you!!

  • @samchristopher6906
    @samchristopher6906 2 ปีที่แล้ว +1

    After 7 months a legend is finally back

  • @minetestfan1015
    @minetestfan1015 2 ปีที่แล้ว +2

    Slash commands and interactions please. Great VID! Been curious about hikari for sometime now.

  • @marbialyiusz_4588
    @marbialyiusz_4588 2 ปีที่แล้ว +1

    Man, you're pretty underrated!
    This is really helpful, thanks.
    Definitely gonna follow this series, waiting for more!

  • @hishamabdulhak539
    @hishamabdulhak539 2 ปีที่แล้ว

    starting the new year off with a new lucas upload!! 2022 is starting off good

  • @nsida_maichart
    @nsida_maichart ปีที่แล้ว +2

    For anyone who met the """UnicodeDecodeError: 'cp950' codec can't decode byte 0xe5 in position 95: illegal multibyte sequence""" error when running """python bot.py""", you will have to go to the folder where python and hikari was installed. Then edit ux.py Line 160 : change the """open("r")""" to """ open("r",encoding = "UTF-8") """

  • @jimmyscott5144
    @jimmyscott5144 2 ปีที่แล้ว +5

    Why hikari and not discord.py? Hikari is newer and has less documentation and I think would be harder for someone new because it does not have as big of a community. I don't know python well but I see so many tutorials for discord.py but switching while trying to learn seems a bit too confusing

  • @Dawnbringer1
    @Dawnbringer1 2 ปีที่แล้ว

    lifesaver! hopefully the other videos will come soon!

  • @mxrcelical7679
    @mxrcelical7679 2 ปีที่แล้ว +1

    He's back!

  • @schnitzy9589
    @schnitzy9589 2 ปีที่แล้ว +1

    Looking forward to this!😃

    • @schnitzy9589
      @schnitzy9589 ปีที่แล้ว

      Ohh boys I’m bored so back here again!

  • @Haikuno
    @Haikuno 2 ปีที่แล้ว +3

    If you're on Linux, you probably already know this, but to activate the virtual environment you need to run:
    source env/bin/activate

    • @Far-YT
      @Far-YT 2 ปีที่แล้ว +1

      I'm on mac you saved my problem thanks mate :)

    • @ndp0830
      @ndp0830 2 ปีที่แล้ว

      I’m on Mac too but it said permission denied…

    • @TapirTot
      @TapirTot 2 ปีที่แล้ว +1

      I did not know this, Thanks!

  • @samineumanntaylor6345
    @samineumanntaylor6345 2 ปีที่แล้ว

    Dude your back. I loved your dpy rewrite series

  • @kavinr.p3556
    @kavinr.p3556 2 ปีที่แล้ว +2

    SICK WALLPAPER

    • @moosie5544
      @moosie5544 2 ปีที่แล้ว

      Do you know which wallpaper that is?

  • @prince7187
    @prince7187 2 ปีที่แล้ว

    Thank god, you are back. I missed this.

  • @mrgokulbig6298
    @mrgokulbig6298 2 ปีที่แล้ว

    Lucas is BACK!

  • @Lucas-tz3jp
    @Lucas-tz3jp  2 ปีที่แล้ว +8

    I am a little bit sick but hopefully I don't sound too bad :(

    • @namanbiswajit9756
      @namanbiswajit9756 2 ปีที่แล้ว

      Sounds fine to me no problem dude

    • @shreyas449
      @shreyas449 2 ปีที่แล้ว

      Dad

    • @Rakhshita_g
      @Rakhshita_g 2 ปีที่แล้ว

      Get well soon and thanks for making this series ☺️

    • @alpha18_81
      @alpha18_81 2 ปีที่แล้ว

      Hey, if I run the script, it gives me that rainbow-ish hikari text and everything looks fine. But the bot doesn't go online. I checked the token, I reinstalled hikari, but it wont start the bot. I went over to pycharm and there it says me that it can't find the hikari libary, even after reinstalling again... Am I again the only one in the world with this problem or does someone know a fix for that problem?? :/

    • @namanbiswajit9756
      @namanbiswajit9756 2 ปีที่แล้ว

      @@alpha18_81 did you created virtualenv and activated it properly?

  • @rpfl5059
    @rpfl5059 2 ปีที่แล้ว +1

    I WAS TRYING TO DO THIS FOR A WEEK THANKYOU

  • @gamingworm8827
    @gamingworm8827 2 ปีที่แล้ว +1

    Hey, thanks for the great serious looking forward to it.

  • @anonylol537
    @anonylol537 2 ปีที่แล้ว +1

    why does yours say \Users\desktop\discordbot>python
    and my says \Users\kober\PycharmProjects\DiscordBot??
    i need help and when i type -m venv env it doesnt work

  • @mirzaadnan3012
    @mirzaadnan3012 2 ปีที่แล้ว +2

    You have such an amazing voice and your videos are very easy to follow along. Thank you for this. I would absolutely love to see you make tutorials on other topics beside discord bots

  • @hillybankok
    @hillybankok 2 ปีที่แล้ว

    i forgot the application.commands but then it worked
    tysm

  • @리코링
    @리코링 2 ปีที่แล้ว

    welcom back!

  • @skmkq
    @skmkq 2 ปีที่แล้ว +1

    History repeats itself for the third time and does'nt cease to be cool. Keep it up.

  • @kameblitz
    @kameblitz 2 ปีที่แล้ว +1

    Uhhh...
    Hii!
    So actually I saw your vids and pretty much liked it however there were huge gaps between some of them. So can you upload consistently for this series if possible?

  • @justeenleidioso2150
    @justeenleidioso2150 2 ปีที่แล้ว

    You came back!

  • @alooflemur1492
    @alooflemur1492 2 ปีที่แล้ว

    i'm new to visual studio how do you get to that screen at 4:42 ?

  • @harek231
    @harek231 2 ปีที่แล้ว

    Welcome Back!!!

  • @m.nandanbhandary8742
    @m.nandanbhandary8742 2 ปีที่แล้ว +3

    A small tip : Increase the font size or zoom in because it is kinda hard to read even at 1080p.

  • @hactavis
    @hactavis 2 ปีที่แล้ว +1

    what theme do you use for vsc?

  • @Ren-io4sx
    @Ren-io4sx 2 ปีที่แล้ว +1

    Hey man, what kind of theme are you using on VSCode

  • @DXAssassin
    @DXAssassin 2 ปีที่แล้ว

    ooo a new series?! amazing, keep it up!

  • @pelusa1241
    @pelusa1241 2 ปีที่แล้ว

    Continue with more videos like this one about Discord Bot! Music, Level, Embeds, Reaction Roles and so on.

  • @totobs1
    @totobs1 2 ปีที่แล้ว

    YAY! THANKS MAN!

  • @BenIsFound
    @BenIsFound 2 ปีที่แล้ว +1

    Round 3 here we go

  • @oz9985
    @oz9985 2 ปีที่แล้ว +1

    Hey when I host my bot i see the ram goes higher and higher out of nowhere. Any idea how to fix it ?

  • @Rakhshita_g
    @Rakhshita_g 2 ปีที่แล้ว

    Welcome back

  • @kookeekwisp
    @kookeekwisp 2 ปีที่แล้ว +1

    Why is it when i do this, my bot's not online after running it?

  • @RaghavKarthik1778
    @RaghavKarthik1778 2 ปีที่แล้ว

    Welcome back! This tutorial was really helpful! Thanks! (:

  • @benbo9560
    @benbo9560 2 ปีที่แล้ว

    New serise lets go

  • @Sciencedoneright
    @Sciencedoneright 2 ปีที่แล้ว +24

    By the way, discord tokens are valuable, do not show them to anyone else. They must be kept private, and they can be misused in case it was leaked. In case you leaked a token, regenerate it and replace the old token with the new one. Happy coding!

  • @kranz9377
    @kranz9377 2 ปีที่แล้ว

    This is pretty cool

  • @divyamsamarwal5752
    @divyamsamarwal5752 2 ปีที่แล้ว

    Awesome

  • @afterhours5466
    @afterhours5466 2 ปีที่แล้ว +3

    it gives me an error when i type ".\env\Scripts\activate'

    • @sleepywithspeed
      @sleepywithspeed 2 ปีที่แล้ว

      Change the default terminal from powershell to cmd

    • @-will-1389
      @-will-1389 2 ปีที่แล้ว

      me too

  • @ayqet
    @ayqet 2 ปีที่แล้ว +2

    Hi Lucas, whenever I try and run .env\Scripts\activate I keep getting an error which is (The module '.env' could not be loaded) and then it tells me to run ('Import-Module .env') and I still get an error after that. Do you know how to fix this, thanks.

    • @MomIsCrying
      @MomIsCrying 2 ปีที่แล้ว

      this from @Redfly from this somment section
      "NOTE: when making the virtual environment, you may get an error saying that your execution policy is wrong. I tried running VS code as an admin, but then it wouldn't let me open the folder. You can solve this by switching your intergrated promt from the default(powershell) to cmd. Thanks for the tutorial btw, it really helps =)"

    • @rockoyhead
      @rockoyhead 2 ปีที่แล้ว

      Yo I found a fix for it just watch this vid mate. th-cam.com/video/X7mg3pJfhZQ/w-d-xo.html

  • @owotaku2712
    @owotaku2712 2 ปีที่แล้ว

    Thx, can ask you one thing, I have 2 laptops and one pc but in my two laptops I can programming a bots for discord (also profile of windows are diferentes) however in my pc I can’t programming a bot, I mean test a bot (also the pc share the same profile windows from one of my laptops) my question is why I have discord.error HTT etc unauthorizatio?

  • @Ev0Duck
    @Ev0Duck 2 ปีที่แล้ว +1

    Can you make a musicbot part with queues and search + link stuff

  • @styres933
    @styres933 2 ปีที่แล้ว +3

    What is the difference to the series before?
    The hikari? Why use this and not the normal api for python?

    • @Lucas-tz3jp
      @Lucas-tz3jp  2 ปีที่แล้ว +4

      discord.py which was used in the last series, has been abandoned and will no longer be updated. I have moved on to using hikari thus the new series :)

    • @froststeel
      @froststeel 2 ปีที่แล้ว

      @@Lucas-tz3jp What about pycord?

    • @goldmannation
      @goldmannation 2 ปีที่แล้ว

      @@Lucas-tz3jp this comment didnt age well

    • @knightmare4874
      @knightmare4874 2 ปีที่แล้ว

      @@goldmannation why hasnt it age well?

  • @-karma1394
    @-karma1394 2 ปีที่แล้ว +2

    Why do i get a message saying “No module name ‘hikari’?

  • @montecristo31
    @montecristo31 2 ปีที่แล้ว

    thaks, man!

  • @TydinisGR
    @TydinisGR 2 ปีที่แล้ว

    thanks for making this tutorial and please try to continue finishing this new series of teaching how to make discord bot in python!
    and also is the 2 series in ur channel are outdated?

  • @celaph8734
    @celaph8734 2 ปีที่แล้ว +2

    can i get the background?

  • @noerror9404
    @noerror9404 2 ปีที่แล้ว +1

    Upload more tutorial on this topic plsssssssssssss

  • @TehNitro
    @TehNitro 2 ปีที่แล้ว +1

    What about some moderation commands?

  • @efipx
    @efipx 2 ปีที่แล้ว +3

    Traceback (most recent call last):
    File "C:\Users\andre\env\disc_bot_test2.py", line 1, in
    import hikari
    ModuleNotFoundError: No module named 'hikari'
    pls help i did every step

    • @Rihards_Gold
      @Rihards_Gold 2 ปีที่แล้ว +2

      Do "pip install hikari-tanjun" That solved it for me

    • @sleepywithspeed
      @sleepywithspeed 2 ปีที่แล้ว

      Try restarting your computer, that worked for me

    • @rockoyhead
      @rockoyhead 2 ปีที่แล้ว

      @@Rihards_Gold You are a god thanks my friend.

  • @censr6616
    @censr6616 2 ปีที่แล้ว +1

    For anyone struggling with an error that looks something like this: ModuleNotFoundError: No module named 'hikari', restarting my vs code seemed to have fixed the issue

  • @leeandasi1383
    @leeandasi1383 ปีที่แล้ว

    Hi, I am having trouble on discord. There are no servers to add on the drop down list. What should I do?

  • @adjectif3887
    @adjectif3887 2 ปีที่แล้ว

    thanks

  • @raksshana1197
    @raksshana1197 2 ปีที่แล้ว

    how do i make the virtual enviroment on a mac? i cant use cmd because my default is zsh

  • @just_andro
    @just_andro 2 ปีที่แล้ว

    Coool

  • @SlimeyDev
    @SlimeyDev 2 ปีที่แล้ว +1

    What is ur upload schedule?

  • @squish7831
    @squish7831 2 ปีที่แล้ว

    Hey man, you helped me alot with coding, thank you so much! i would love to see more content ✨

  • @sandiguha
    @sandiguha 2 ปีที่แล้ว

    The background picture shows the place of 'Kailash' - the home of Lord Shiva and how I could tell this because can you spot that artifact beside the tree, that's the 'Trishul' or Trident of Lord Shiva.

  • @lautre9873
    @lautre9873 2 ปีที่แล้ว

    i mean... for the first step it say something about the powershell that i can open the "env" ?
    is it normal ?

  • @dextero
    @dextero 2 ปีที่แล้ว +1

    Why not use nextcord or pycord?

  • @gagans9302
    @gagans9302 2 ปีที่แล้ว

    Nice 👍🏻🙂

  • @nightshadepoision
    @nightshadepoision 2 ปีที่แล้ว +1

    I can't seem to get into the env file im on Linux Ubuntu.

    • @milkmannoodles3783
      @milkmannoodles3783 2 ปีที่แล้ว

      I'm having the same issue

    • @milkmannoodles3783
      @milkmannoodles3783 2 ปีที่แล้ว

      th-cam.com/video/bkfdMOaqZuk/w-d-xo.html found this youtube video that explains how to do it on linux

  • @dagdbot83
    @dagdbot83 2 ปีที่แล้ว +1

    He bac

  • @EnglishRain
    @EnglishRain 2 ปีที่แล้ว

    Thank youuuuuuuu

  • @abdistic1047
    @abdistic1047 2 ปีที่แล้ว

    works on replit aswell?

  • @revelmonger
    @revelmonger 2 ปีที่แล้ว

    Nice voice drop.

  • @emetz2293
    @emetz2293 2 ปีที่แล้ว

    Whenver I run the code it tells me that "module 'hikari' has no attribute 'GateWayBot' "

  • @KanaIsTheCutest
    @KanaIsTheCutest 2 ปีที่แล้ว

    is there a way hikari can delete messages or kick/ban, basic functionalities

  • @its_shuay
    @its_shuay 2 ปีที่แล้ว

    I am getting a "No Module Named venv" when running python -m venv env
    How do I fix this error?
    (I am also using VS Code)

  • @doubled8846
    @doubled8846 2 ปีที่แล้ว

    can i use pycharm for this?

  • @kazzoo8359
    @kazzoo8359 2 ปีที่แล้ว

    im sorry i rlly couldnt tell what he typed after python in 5:18
    the subtitles said "dash m" so i tried that but it didnt work ;-; pls help

    • @noobpwnn
      @noobpwnn 2 ปีที่แล้ว

      python -m venv venv if your are on Mac or linux make it python3

  • @ikenz1e
    @ikenz1e 2 ปีที่แล้ว +1

    after installing hikari and writing the import line i get this error "Import "hikari" could not be resolved Pylance (reportMissingImports)" it worked at first but after a while of coding it stopped working

    • @rinka8430
      @rinka8430 2 ปีที่แล้ว

      its: "import hikari" not "Import hikari"

    • @josuedelatorre35
      @josuedelatorre35 2 ปีที่แล้ว

      @@rinka8430 still doesn't work, it says " ModuleNotFoundError: No module named 'hikari' "

    • @rinka8430
      @rinka8430 2 ปีที่แล้ว

      @@josuedelatorre35 so that is because u didnt install hikari, run this code in ur terminal: pip install hikari

    • @alpha18_81
      @alpha18_81 2 ปีที่แล้ว

      @@rinka8430 I got the same error, i reinstalled twice but I still get this error

    • @rinka8430
      @rinka8430 2 ปีที่แล้ว

      @@alpha18_81 so try this commands:
      pip3 install hikari
      pip install hikari
      python -m pip install hikari
      python3 -m pip install hikari
      py -m pip install hikari
      py3 -m pip install hikari

  • @jurgitaguobiene8504
    @jurgitaguobiene8504 2 ปีที่แล้ว

    it says no module hikari and i don't know what to do. can you help me?

  • @InfiniteSciences
    @InfiniteSciences 2 ปีที่แล้ว

    For me, IG its saying that python is not there. Could you assist me on this?

  • @helish_88
    @helish_88 2 ปีที่แล้ว

    refresh token, lmao. it was cool.

  • @0xsuperman
    @0xsuperman 2 ปีที่แล้ว

    Will this series cover how to make a bot to post messages to specific channels (not to respond to specific command in discord chat)?

  • @gauravuttarkar9682
    @gauravuttarkar9682 2 ปีที่แล้ว

    What's the difference between this series and the previous one?

  • @vent_srikar7360
    @vent_srikar7360 2 ปีที่แล้ว

    any resource for me to learn how to code a discord bot using hikari

  • @idontknowhatoput8663
    @idontknowhatoput8663 2 ปีที่แล้ว

    what's that wallpaper it looks pretty cool

  • @therealshelly
    @therealshelly 2 ปีที่แล้ว

    thank you, this helps me a lot, +1 sub

  • @paired7815
    @paired7815 2 ปีที่แล้ว

    thanks how to join your discord server. the invite link expired

  • @minseokwon9723
    @minseokwon9723 2 ปีที่แล้ว

    why does event.content return none

  • @fuzoken7698
    @fuzoken7698 2 ปีที่แล้ว

    man when i am activating environment it says cannot be loaded because running scripts is disabled on
    this system. do you know something abt it?

    • @m1n3c4rt
      @m1n3c4rt 2 ปีที่แล้ว

      run Set-ExecutionPolicy -ExecutionPolicy Unrestricted, it works for me

    • @sleepywithspeed
      @sleepywithspeed 2 ปีที่แล้ว

      Change your default terminal to cmd in vs code settings

  • @Games.On.Wheels
    @Games.On.Wheels 2 ปีที่แล้ว

    Could you make a tutorial on how to set this up on a Raspberry Pi 4?

  • @SlimeyDev
    @SlimeyDev 2 ปีที่แล้ว +1

    plz can u do tutorials using pycord plzzzzzzz

  • @fiorequenttaypin
    @fiorequenttaypin 2 ปีที่แล้ว

    what is the short cut to terminate the terminal?

    • @melonkat_cool
      @melonkat_cool 4 หลายเดือนก่อน

      ctrl + c; probably too late :)

  • @SourSlick
    @SourSlick 2 ปีที่แล้ว

    do you technically need hikari to have a good bot?

  • @premiumboi473
    @premiumboi473 2 ปีที่แล้ว

    I’m on a 24’ M1 iMac and I’m trying to get the bot running on it, I got a certificate not verified error, I know you on a windows but would be great if you or anyone els have a solution for me

    • @JustMastermind
      @JustMastermind 2 ปีที่แล้ว

      @@olivierberg5855 If I do this, I get the following error:
      ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/certifi'
      Consider using the `--user` option or check the permissions.

    • @JustMastermind
      @JustMastermind 2 ปีที่แล้ว

      @@olivierberg5855 What can I do, to fix that error?

  • @ArtByAhri
    @ArtByAhri 2 ปีที่แล้ว

    how can u keep your bot up 24/7 ?

  • @enriquealba5345
    @enriquealba5345 2 ปีที่แล้ว

    i did everything exaclty the same but I never got the rainbow hitari I have the error hikari has no attribute gatewaybot

    • @enriquealba5345
      @enriquealba5345 2 ปีที่แล้ว

      nvm just save the file at the end then run it
      right before python.py

  • @nerolized1209
    @nerolized1209 2 ปีที่แล้ว

    it is showing that hikari is not installed but when i tried it installing it again, it showed requirement already satisfied :\
    edit: and im usind python 3.9