summaryrefslogtreecommitdiff
path: root/bot.py
diff options
context:
space:
mode:
authorNatrixAeria <upezu@student.kit.edu>2020-09-28 02:48:38 +0200
committerNatrixAeria <upezu@student.kit.edu>2020-09-28 02:48:38 +0200
commit89e0c7df2b88daf83b6a415c1ab2b95e2d6bc46d (patch)
treec2ded0c4b7ff7a76a5a399d41e0df35f1f52ef7b /bot.py
parent778b54f50f81151cbd1bd2e62f5c6d69c4ca0cf0 (diff)
Alter command property syntax
Diffstat (limited to 'bot.py')
-rw-r--r--bot.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/bot.py b/bot.py
index a7e042a..ced131d 100644
--- a/bot.py
+++ b/bot.py
@@ -1,14 +1,17 @@
+import discord
import config
-from command_utils import Command, CommandClient
+from command_utils import command, CommandClient
class Client(CommandClient):
async def on_ready(self):
print(f'the bot {config.NAME} is logged in as "{self.user}"')
- @Command.help_command
- @Command.names('help', 'hepl', 'h', '?')
- @Command.description('display this help message')
+ @command(
+ names = ('help', 'hepl', 'h', '?'),
+ description = 'display this help message',
+ is_help = True
+ )
async def help(self, ctx):
command_doc = '\n'.join(
f' * {config.COMMAND_PREFIX.strip()} {c.names[0]:15} - {c.description}'
@@ -16,8 +19,10 @@ class Client(CommandClient):
await ctx.answer(f'''```
{config.HELP_TEXT}\nThese are all available commands:\n{command_doc}```''')
- @Command.names('init', 'create', 'inti', 'craete', 'cretae', 'c', 'i', '+')
- @Command.description('create a new lobby')
+ @command(
+ names = ('init', 'create', 'inti', 'craete', 'cretae', 'c', 'i', '+'),
+ description = 'create a new lobby'
+ )
async def init(self, ctx):
await ctx.answer(f'NIY')
@@ -28,5 +33,5 @@ if __name__ == '__main__':
if token is None:
print('error: no token was given')
exit(1)
- bot = Client()
+ bot = Client(activity=discord.Game(name=config))
bot.run(token)