Last active
July 10, 2020 08:32
-
-
Save Wiper-R/3415fea80b1d8b833cb074d708438c13 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
from discord.ext import commands, flags | |
import discord | |
bot = commands.Bot(command_prefix = '.') | |
class Flags(commands.Cog): | |
def __init__(self, bot): | |
self.bot = bot | |
@flags.add_flag('--name', type=str) | |
@flags.add_flag('--times', type=int) | |
@flags.command() | |
async def hello(self, ctx, **flags): | |
for _ in range(flags['times']): | |
await ctx.send(f'Hello {flags["name"]}') | |
@commands.Cog.listener() | |
async def on_ready(self): | |
print("Bot is ready!") | |
bot.add_cog(Flags(bot)) | |
bot.run("TOKEN") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment