Discord.py: i can't make my own bot

Created on 18 Oct 2019  ·  4Comments  ·  Source: Rapptz/discord.py

Hi there
here is my 3 files

3 bots.zip
tryed to make 3 times bot, one from this 3 file i made bot,but it's offline
how can i make it online?

question

Most helpful comment

Oh no! You just leaked your bot token!

You accidentally gave out your code and forgot to remove the token! What does that do?
Well, it leads to letting users access your bot acccount/controlling it.
Don't worry, you can reset your token anytime!

You only have to go on https://discordapp.com/developers/applications/ and generate a new token under the bot tab.

Make sure next time you don't leak your bot token.
Always keep in mind that you have to remove the bot token before taking a screenshot or sending your code to get help.

Now that we have that out of the way, I'll go through a few things wrong with those files.

  1. In forumbot.py, the language used is actually not Python, and is instead, JavaScript.
  2. In rockbot.py, the token passed in client.run() is not a valid token, and looks more like a client secret, which is why you are getting the improper token error.
  3. In rockforumbot.py, you import Discord, not discord (Capitalization is important).
  4. Also in rockforumbot.py, you use code from a branch of this library that has been deprecated since April 2019 (client.send_message() has been changed to abc.Messageable.send()).

Finally, this is not an issue with discord.py. GitHub issues for this repository should be used to report issues with this library. They are not a medium for requesting help with Python. For further help specific to using this library, you should join either the official discord.py server or the Discord API server, and for help with Python in general, you should join the official Python server.

All 4 comments

github issues should be used to point out issues with the library. try our discord server for help with this.

when i run one of them i see this

Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:21:23) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> 
====== RESTART: C:\Users\User\Desktop\Stuff\discord bot\ресурси\rockbot.py =====
Traceback (most recent call last):
  File "D:\porgrams\Python\lib\site-packages\discord\http.py", line 258, in static_login
    data = await self.request(Route('GET', '/users/@me'))
  File "D:\porgrams\Python\lib\site-packages\discord\http.py", line 222, in request
    raise HTTPException(r, data)
discord.errors.HTTPException: 401 UNAUTHORIZED (error code: 0): 401: Unauthorized

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\User\Desktop\Stuff\discord bot\ресурси\rockbot.py", line 10, in <module>
    client.run('w36Ok2xPAOb-cEyqC54YHqdlB9J76ohI')
  File "D:\porgrams\Python\lib\site-packages\discord\client.py", line 598, in run
    return future.result()
  File "D:\porgrams\Python\lib\site-packages\discord\client.py", line 579, in runner
    await self.start(*args, **kwargs)
  File "D:\porgrams\Python\lib\site-packages\discord\client.py", line 542, in start
    await self.login(*args, bot=bot)
  File "D:\porgrams\Python\lib\site-packages\discord\client.py", line 400, in login
    await self.http.static_login(token, bot=bot)
  File "D:\porgrams\Python\lib\site-packages\discord\http.py", line 262, in static_login
    raise LoginFailure('Improper token has been passed.') from exc
discord.errors.LoginFailure: Improper token has been passed.
>>> 
how can i fix it?

github issues should be used to point out issues with the library. try our discord server help with this.

ᵗʰᵉ ᵗᵒᵏᵉⁿ ᶦˢ ᶦⁿᵛᵃˡᶦᵈ

Oh no! You just leaked your bot token!

You accidentally gave out your code and forgot to remove the token! What does that do?
Well, it leads to letting users access your bot acccount/controlling it.
Don't worry, you can reset your token anytime!

You only have to go on https://discordapp.com/developers/applications/ and generate a new token under the bot tab.

Make sure next time you don't leak your bot token.
Always keep in mind that you have to remove the bot token before taking a screenshot or sending your code to get help.

Now that we have that out of the way, I'll go through a few things wrong with those files.

  1. In forumbot.py, the language used is actually not Python, and is instead, JavaScript.
  2. In rockbot.py, the token passed in client.run() is not a valid token, and looks more like a client secret, which is why you are getting the improper token error.
  3. In rockforumbot.py, you import Discord, not discord (Capitalization is important).
  4. Also in rockforumbot.py, you use code from a branch of this library that has been deprecated since April 2019 (client.send_message() has been changed to abc.Messageable.send()).

Finally, this is not an issue with discord.py. GitHub issues for this repository should be used to report issues with this library. They are not a medium for requesting help with Python. For further help specific to using this library, you should join either the official discord.py server or the Discord API server, and for help with Python in general, you should join the official Python server.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JackL0 picture JackL0  ·  3Comments

ghost picture ghost  ·  3Comments

AraHaan picture AraHaan  ·  3Comments

danshat picture danshat  ·  3Comments

Spyder-exe picture Spyder-exe  ·  3Comments