Discord bot not responding to command [New User] - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Discord bot not responding to command [New User] (/thread-10434.html) |
Discord bot not responding to command [New User] - Alabaster - May-20-2018 I figured that I would give Python a shot by writing a Discord bot. The Load command is giving me trouble; it refuses to run, even though I recall it functioning the night I had started scripting, about two days ago. The console doesn't display any errors, and nothing I've tried has worked. import discord import random from discord import Game from discord.ext.commands import Bot BOT_PREFIX = ">" LOAD_PREFIX = "LOAD" TOKEN = "[REDACTED]" GAME = "with Specimen-07" client = Bot(command_prefix=BOT_PREFIX) #Display information for PROMETHEUS @client.event async def on_ready(): await client.change_presence(game=Game(name=GAME)) print("PROMETHEUS unit is now online") #Help Command @client.event async def on_message(message): if message.content.upper().startswith(BOT_PREFIX + "HELP"): userID = message.author.id await client.send_message(message.channel, "<@%s> ```Instructions sent to Personal Communications.```" % (userID)) await client.send_message(message.author, """```TEST```""") #CURRENTLY UNDER DEVELOPMENT BUT I THINK IM GETTING THE HANG OF THIS @client.command(name="Load", aliases=["load", "LOAD"]) async def Load(category): if category(): await client.say(message.channel, """```TEST```""") elif category("SDATA", ): await client.say(message.channel, """```TEST```""") elif category("ADATA"): await client.send_message(message.channel, """```TEST```""") client.run(TOKEN) |