Last active
January 15, 2022 09:04
-
-
Save AWeirdDev/761d576bf833f746534b574e3ef2b084 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Umm This Is Still In Beta But Okie |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Author
AWeirdDev
commented
Oct 2, 2021
•
- Sleep
- sleep
- sleep
- sleep
- sleep
- sleep
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment