亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Discord.py selfbot 腳本退出而不是連接到令牌

Discord.py selfbot 腳本退出而不是連接到令牌

慕碼人8056858 2023-04-25 15:35:59
我正在制作一個不和諧的自我機器人來向我的朋友服務器發送垃圾郵件。但是,在調試過程中,我遇到了很多問題。在此處修復我的部分代碼后: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)請讓我知道您認為問題出在哪里。任何幫助將不勝感激。
查看完整描述

1 回答

?
忽然笑

TA貢獻1806條經驗 獲得超5個贊

您可以將所有標記讀入列表并像這樣循環整個代碼。


with open("tokens.txt", "r") as f:

    tokens = f.read().splitlines()

    

for token in tokens:

    

    # code here 

    

    client.run(token)


查看完整回答
反對 回復 2023-04-25
  • 1 回答
  • 0 關注
  • 138 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號