Skip to content

Commit d3c7219

Browse files
Marckmarck
andauthored
Errors when logging in should catch and coffee command (#33)
* This should be catching * Logging and random coffee Co-authored-by: marck <marck@noneofyabusiness.com>
1 parent 84d0105 commit d3c7219

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

cogs/fun.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ async def duck(self, ctx):
6767
""" Posts a random duck """
6868
await self.randomimageapi(ctx, 'https://random-d.uk/api/v1/random', 'url')
6969

70+
@commands.command()
71+
@commands.cooldown(rate=1, per=1.5, type=commands.BucketType.user)
72+
async def coffee(self, ctx):
73+
""" Posts a random coffee """
74+
await self.randomimageapi(ctx, 'https://coffee.alexflipnote.dev/random.json', 'file')
75+
7076
@commands.command(aliases=['flip', 'coin'])
7177
async def coinflip(self, ctx):
7278
""" Coinflip! """

index.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@
1818
name = file[:-3]
1919
bot.load_extension(f"cogs.{name}")
2020

21-
bot.run(config.token)
21+
try:
22+
bot.run(config.token)
23+
except Exception as e:
24+
print(f'Error when logging in: {e}')

0 commit comments

Comments
 (0)