Sofianbrb / discord-mirror

This is a program to mirror a channel to another using selfbots using discord.py-self library. Beginner-friendly, open source and available help on Discord. See readme file for all the details... For fast help, please contact me on Disocrd (Bird そ#2911)
3 stars 1 forks source link

Error #2

Open lecanardmarinmarchand opened 1 year ago

lecanardmarinmarchand commented 1 year ago

Hello ! I'm trying to run the Discord bot but I keep getting this error. Can you help me ?

07.07 12:18:14 [Bot] Traceback (most recent call last): 07.07 12:18:14 [Bot] File "/./Bot1/main.py", line 218, in 07.07 12:18:14 [Bot] account_token = get_account_token() 07.07 12:18:14 [Bot] File "/./Bot1/main.py", line 60, in get_account_token 07.07 12:18:14 [Bot] with open('data.json', 'r') as f: 07.07 12:18:14 [Bot] FileNotFoundError: [Errno 2] No such file or directory: 'data.json'

Sofianbrb commented 1 year ago

Hey,

The problem here is very simple, you're missing the "data.json" file. You I assume didn't download it with the main.py file. It is being used to store your token - so you don't have to put it each time you restard the file - and the channels ID with their webhooks.

So the solution would be to download the 'data.json' file from the "code" section on this project and put it in the same folder as the "main.py" file on your computer. After that it should be fine 👍

If you have any more question let me know!

lecanardmarinmarchand commented 1 year ago

Hello,

That's a bit weird, I did download it with the json file.

lecanardmarinmarchand commented 1 year ago

image

Sofianbrb commented 1 year ago

Then it must be that you did launch the file with its full path instead of navigating through your directories So the solution would be to navigate to the folder and launch it from there (Doing the usual "cd [folder]" until you're at it and then "python3 main.py")

if it's not this the problem I don't know what it could be else. by the way, be sure to download discord.py-self and not discord.py, else the token won't work

lecanardmarinmarchand commented 1 year ago

Seems like I got it worked.

Now I got this instead.

image

Sofianbrb commented 1 year ago

Can you paste exactly what’s on the json file in the project into your json file? And then try again

lecanardmarinmarchand commented 1 year ago

image

Sofianbrb commented 1 year ago

It’s working great now 👍

You have to get the token of your account and it’s ready to work. Refer to “readme” to see exactly what you have to do (sorry in advance, it’s a mess)

lecanardmarinmarchand commented 1 year ago

Hello again !

I got it up and running but there's a problem with my token. I did exactly as instructed.

07.07 16:13:39 [Bot] 2023-07-07 17:13:39 [INFO] discord.client logging in using static token 07.07 16:13:39 [Bot] Traceback (most recent call last): 07.07 16:13:39 [Bot] File "/.local/lib/python3.9/site-packages/discord/http.py", line 803, in static_login 07.07 16:13:39 [Bot] data = await self.request(Route('GET', '/users/@me')) 07.07 16:13:39 [Bot] File "/.local/lib/python3.9/site-packages/discord/http.py", line 745, in request 07.07 16:13:39 [Bot] raise HTTPException(response, data) 07.07 16:13:39 [Bot] discord.errors.HTTPException: 401 Unauthorized (error code: 0): 401: Unauthorized 07.07 16:13:39 [Bot] The above exception was the direct cause of the following exception: 07.07 16:13:39 [Bot] Traceback (most recent call last): 07.07 16:13:39 [Bot] File "/main.py", line 672, in 07.07 16:13:39 [Bot] client.run(account_token) 07.07 16:13:39 [Bot] File "/.local/lib/python3.9/site-packages/discord/client.py", line 860, in run 07.07 16:13:39 [Bot] asyncio.run(runner()) 07.07 16:13:39 [Bot] File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run 07.07 16:13:39 [Bot] return loop.run_until_complete(main) 07.07 16:13:39 [Bot] File "/usr/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete 07.07 16:13:39 [Bot] return future.result() 07.07 16:13:39 [Bot] File "/.local/lib/python3.9/site-packages/discord/client.py", line 849, in runner 07.07 16:13:39 [Bot] await self.start(token, reconnect=reconnect) 07.07 16:13:39 [Bot] File "/.local/lib/python3.9/site-packages/discord/client.py", line 777, in start 07.07 16:13:39 [Bot] await self.login(token) 07.07 16:13:39 [Bot] File "/.local/lib/python3.9/site-packages/discord/client.py", line 612, in login 07.07 16:13:39 [Bot] data = await self.http.static_login(token) 07.07 16:13:39 [Bot] File "/.local/lib/python3.9/site-packages/discord/http.py", line 807, in static_login 07.07 16:13:39 [Bot] raise LoginFailure('Improper token has been passed.') from exc 07.07 16:13:39 [Bot] discord.errors.LoginFailure: Improper token has been passed. 07.07 16:13:40 [PebbleHost] Server shut down (running) 07.07 16:13:40 [PebbleHost] Server stopped

lecanardmarinmarchand commented 1 year ago

Ok so it seems like I managed to get it to work but not in the way that I expected.

I made a bot and replaced what's inside of the token field with the bot's token. The problem is that I don't want to use a bot but my Discord account (selfbot).

lecanardmarinmarchand commented 1 year ago

How to do that ?

Sofianbrb commented 1 year ago

You might have discord.py installed, and not discord.py-self

Could you check with pip what you have installed? If you have both of them it won’t work, you absolutely have to only have discord.py-self (On one of your screenshots above, I saw “discord.py” without the self argument so I think this is the problem)