I’m trying to create a selfbot using python that will be able to go on my account, and send a message every 75 seconds.
I created my script but every time i keep trying to upload the script it says improper token has been passed while it’s literally my discord token. Am i doing something wrong? This is the script im using.
import discord
import asyncio
TOKEN = 'not giving that ofcourse'
MESSAGE = 'hi chat'
intents = discord.Intents.default()
client = discord.Client(intents=intents)
async def on_ready():
print(f'Logged in as {client.user}')
while True:
await client.user.send(MESSAGE)
await asyncio.sleep(75) # Sleep for 1 minute and 15 seconds
client.run(TOKEN)
So i tried to create a selfbot that will send ‘hi chat’ every minute and 15 seconds. One issue is that it keeps saying i’m giving a improper token. Is this maybe patched, is my script shit? What’s the issue. Please tell me.
This is the error message im receiving from terminal.
2024-05-18 16:40:02 INFO discord.client logging in using static token
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/discord/http.py", line 803, in static_login
data = await self.request(Route('GET', '/users/@me'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/discord/http.py", line 745, in request
raise HTTPException(response, 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 "/Users/mac/Documents/selfbot.py", line 21, in <module>
client.run(TOKEN)
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/discord/client.py", line 860, in run
asyncio.run(runner())
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/discord/client.py", line 849, in runner
await self.start(token, reconnect=reconnect)
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/discord/client.py", line 777, in start
await self.login(token)
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/discord/client.py", line 612, in login
data = await self.http.static_login(token)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/discord/http.py", line 807, in static_login
raise LoginFailure('Improper token has been passed.') from exc
discord.errors.LoginFailure: Improper token has been passed.
Rayan Meftah is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.