Skip to content

Instantly share code, notes, and snippets.

@AWeirdDev
Last active January 15, 2022 09:04
Show Gist options
  • Save AWeirdDev/761d576bf833f746534b574e3ef2b084 to your computer and use it in GitHub Desktop.
Save AWeirdDev/761d576bf833f746534b574e3ef2b084 to your computer and use it in GitHub Desktop.
Umm This Is Still In Beta But Okie
import discord
from discord.ext import commands
import time
client = commands.Bot(command_prefix="!")
token = 'Your Token'
commands = {}
@client.event
async def on_ready():
print("The Bot Is Online!")
channel = client.get_channel(ChannelId)
await channel.send("Hi! I'm now online!")
@client.command(aliases=['t'])
async def test(ctx):
await ctx.send("Hey There!")
@client.command(pass_context=True)
async def new_command(ctx, command, response):
commands[ctx.guild.id] = [command]
commands[ctx.guid.id].append(response)
await ctx.send('Command created!')
@client.event
async def on_message(message):
"""Make Your Own Command!"""
prefix = "!"
try:
name = commands[message.guild.id][0]
if message.content.startswith(f"{prefix}{name}"):
res = commands[message.guild.id][1]
await message.channel.send(res)
#With Typing Animation:
#async with ctx.typing():
# await asyncio.sleep(1) #or time.sleep(1)
#await message.channel.send(res)
except KeyError:
#Do something else
pass
client.run(token)
@AWeirdDev
Copy link
Author

AWeirdDev commented Oct 2, 2021

  • Sleep

@AWeirdDev
Copy link
Author

  1. sleep
  2. sleep
  3. sleep
  4. sleep
  5. sleep

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment