discord.py

    -2熱度

    1回答

    我有一個小問題,我的Discord bot是用Python編寫的,而且我不斷收到錯誤。這是我的機器人的代碼: import discord import asyncio client = discord.Client() @client.event async def on_ready(): print('Logged in as') print(client.us

    1熱度

    1回答

    如何設置踢命令與角色使用的只是主持人的角色將可以使用 我踢命令: @client.command(pass_context = True) async def kick(ctx, userName: discord.User): """Kick A User from server""" await client.kick(userName) await clien

    -2熱度

    1回答

    İ'm得到這個錯誤我嘗試使用機器人例如一些用戶,但得到這個錯誤時,鍵入help AttributeError的:「消息」對象有沒有屬性「公會」 請幫助也得到這個錯誤 還有這麼多的錯誤獲得更多關於hastebin https://hastebin.com/ipalesajus.sql

    0熱度

    1回答

    我試圖讓用戶的角色來執行的命令的作用: async def clear (ctx, n): if "Mod" in [y.name.lower() for y in ctx.message.author.roles]: //delete messages else: client.send_message(ctx.message.channel, "Yo

    1熱度

    2回答

    如果有人寫「?name(arg)」我想讓我的機器人說消息的作者+「,你的名字是」+ arg。 雖然我找不到消息的作者。 <!-- language: lang-py --> @client.command() async def name(their_name): await client.say("{0}, your name is {1}.".format("""author o

    -1熱度

    2回答

    ,所以我現在有這樣的代碼,這使得一個很可能很可能對我的不和諧機器人,我有這個錯誤的地方說:「齒痕錯誤:預期和縮進塊」 下面是我使用的代碼(見https://hastebin.com/isageyoqih.py) import discord import asyncio import random import pickle import os client = discord.Cli

    0熱度

    2回答

    我當前的代碼內Discord.py無效參數是 @client.event async def on_member_join(member): serverchannel = member.server.default_channel msg = "Wuss poppin', {0}. Welcome to {1}".format(member.mention, member.

    1熱度

    2回答

    import asyncio import discord from discord.ext import commands from discord.ext.commands import Bot import chalk bot = commands.Bot(command_prefix='!') @bot.event async def on_ready():

    0熱度

    1回答

    我想看看我是否能得到一個殭屍自動加入我的服務器,但是當我寫的代碼,然後運行它,我得到這個異常: Ignoring exception in on_ready Traceback (most recent call last): File "C:\Users\datpe\AppData\Local\Programs\Python\Python35\lib\site-packages\di

    -1熱度

    1回答

    我想給一個用戶一個現有的角色。我試着用這段代碼,但它不工作: @client.command() async def give(ctx, member: discord.User): role = discord.utils.get(server.roles, name="admin") await client.add_roles(member, role) 我試圖做一