Python Discord bot-由于某些原因命令将不起作用

时间:2020-03-29 16:56:47

标签: python command discord

所以我正在研究一款不和谐的机器人。和我的机器人命令将无法正常工作。他们没有给我一个错误信息或类似的东西。他们只是不做任何事情。我也试图将命令复制到另一个文件,然后它可以工作。如果我对此有所帮助,我会很高兴。

这是我的代码

import discord
import random
from discord.ext.commands import Bot
from discord.ext import commands
import sys
import os
import cogs
import config
import logging
import asyncio
import datetime
import time

aEmoji = "?"
bEmoji = "?"
cEmoji = "?"
dEmoji = "?"
eEmoji = "?"
fEmoji = "?"
gEmoji = "?"
hEmoji = "?"
iEmoji = "?"
jEmoji = "?"
kEmoji = "?"
lEmoji = "?"
mEmoji = "?"
nEmoji = "?"
oEmoji = "?"
pEmoji = "?"
qEmoji = "?"
rEmoji = "?"
sEmoji = "?"
tEmoji = "?"
uEmoji = "?"
vEmoji = "?"
wEmoji = "?"
xEmoji = "?"
yEmoji = "?"
zEmoji = "?"

oneEmoji = "<:1:692821784965152889> "
twoEmoji = "<:2:692821785023873076> "
threeEmoji = "<:3:692821785535578202>"
fourEmoji = "<:4:692821785149833287> "
fiveEmoji = "<:5:692821785158352947> "
sixEmoji = "<:6:692821785019809842> "
sevenEmoji = "<:7:692821784990318714> "
eightEmoji = "<:8:692821785015746580>"
nineEmoji = "<:9_:692821784956895242> "
zeroEmoji = "<:0:692823874018213970>"

noscopeEmoji = "<:noscope1891:669620448366952470>"
thonkEmoji = "<:thonk:669624604322430986>"
pentaEmoji = "<:pentagram:692807977723363360>"
gayEmoji = "<:gay:670713902144684032>"
prillaEmoji = "<:prilla:692810275295985664>"
zefEmoji = "<:zefside:692993166705426473>"


client = discord.Client()
client = commands.Bot(command_prefix= "*")

snusList = ("XR", "Ettan", "General", "LD", "Lundgrens", "Norrlands", "Siberia")
snusImgurList =("You got Ettan portion : https://imgur.com/K3hrrmz.png",
                "You got General Classic, yummy thats a good one : https://imgur.com/Bfs0gtX.png",
                "You got XR Raspberry & licorice, nice one : https://imgur.com/U2wQa5D.png",
                "You got LD Original : https://imgur.com/sBWI5Ic.png",
                "You got lundgrens Skånes : https://imgur.com/zgD0eZa.png",
                "You got Lundgrens Norrlands, yummy : https://imgur.com/SvlDNeB.png",
                "You got Siberia, o.0 thats a strong one : https://imgur.com/dmaYwRW.png",
                "You got XR Strong, one of my personal favorites : https://imgur.com/wTR3FOf.png",
                "OMG YOU GOT AD SPESIALARE : https://imgur.com/J3sErRB.png")

words = { "ibe" : ["?", "?", "?" ],
          "ibegames" : [noscopeEmoji],
          "epik" : [ "?", "?", "?" ],
          "superkid14" : [ "?", "?", "?", "?", "?", "?", "?", "?" ],
          "mirek" : [ "?" ],
          "noscope" : [noscopeEmoji],
          "noscope1891" : [noscopeEmoji],
          "deathsblessing" : [pentaEmoji],
          "deaths" : [pentaEmoji],
          "badinek" : ["?"],
          "baduinek" : ["?"],
          "mrszarak" : ["?️"],
          "szarak" : ["?️"],
          "zef" : [zefEmoji],
          "xzefx" : [zefEmoji]
        }



@client.event
async def on_ready():
    print("*BOT ONLINE*")
    await client.change_presence(activity=discord.Game(name="Snus " + random.choice(snusList)))



@client.event
async def on_message(message):
    for word, emojis in words.items():
        if message.content.lower().startswith(word):
            time.sleep(1)
            for emoji in emojis:
                await message.add_reaction(emoji)
            break

@client.command()
async def Ping(ctx):
    await ctx.send("Pong")


client.run("NjkyNzQ5NzEyMTE3NDY1MTc4.XnzDdw.2QrV5Ks06YpDyRpbJ7mK5qxV4Q8")

感谢您的帮助! 编辑:更改了令牌,因为我泄漏了它。

0 个答案:

没有答案