Skip to content

Commit 5130ca4

Browse files
committed
Define ctx as ApplicationContext
1 parent 82a2b85 commit 5130ca4

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

main.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -204,27 +204,27 @@ async def on_message(message):
204204

205205
# Commands
206206
@client.command()
207-
async def uptime(ctx):
207+
async def uptime(ctx: ApplicationContext):
208208
uptime = str(datetime.timedelta(seconds=int(round(time.time()-startTime))))
209209
await ctx.send(f'This session has been running for **{uptime}**')
210210

211211
@client.command(aliases=['commands'])
212-
async def help(ctx):
212+
async def help(ctx: ApplicationContext):
213213
emb = discord.Embed(title=f'increment.io Commands', description=f'I am a counting bot who looks for numbers and makes sure that the count doesn\'t get messed up. If you want help on commands or want a more organized view, check https://notsniped.github.io/increment.io/commands\n :warning: This bot is still WIP. Some commands/features may not work as expected.\n\n**Prefix:** ```Main Prefix: +```\n**Information:** ```+help, +ping, +stats, +serverstats,+credits```\n**Counting:** ```+setchannel, +numberonly [on/off], +reactions [on/off], +setnumber [number], +resetcount```', color=theme_color)
214214
await ctx.send(embed = emb)
215215

216216
@client.command(aliases=['pong'])
217-
async def ping(ctx):
217+
async def ping(ctx: ApplicationContext):
218218
await ctx.send(f':ping_pong: Pong! In **{round(client.latency * 1000)}ms**.')
219219

220220
@client.command()
221-
async def credits(ctx):
221+
async def credits(ctx: ApplicationContext):
222222
emb = discord.Embed(title='Bot Credits', description='Owner: <@!738290097170153472>\nHelpers: <@!706697300872921088>, <@!705462972415213588>',color=theme_color)
223223
emb.set_footer(text='increment.io >> https://notsniped.github.io/increment.io')
224224
await ctx.send(embed=emb)
225225

226226
@client.command()
227-
async def serverstats(ctx):
227+
async def serverstats(ctx: ApplicationContext):
228228
servericon = ctx.guild.icon_url
229229
setchannelstats = countchannel[str(ctx.guild.id)]
230230
setchannelmaxcount = count[setchannelstats]
@@ -237,7 +237,7 @@ async def serverstats(ctx):
237237
# Count Commands
238238
@client.command()
239239
@commands.has_permissions(administrator = True)
240-
async def setchannel(ctx):
240+
async def setchannel(ctx: ApplicationContext):
241241
try:
242242
countchannel[str(ctx.guild.id)] = ctx.channel.id
243243
savedata()
@@ -246,7 +246,7 @@ async def setchannel(ctx):
246246

247247
@client.command()
248248
@commands.has_permissions(administrator = True)
249-
async def reactions(ctx, setting:str):
249+
async def reactions(ctx: ApplicationContext, setting: str):
250250
if setting == 'on':
251251
if autoreactions[str(ctx.guild.id)] == 1: await ctx.send(':warning: This feature is already enabled.')
252252
else:
@@ -262,7 +262,7 @@ async def reactions(ctx, setting:str):
262262
else: await ctx.send(f'\'{setting}\' is not a valid option. You can choose between `on` and `off`')
263263

264264
@client.command(aliases=['setnum'])
265-
async def setnumber(ctx, arg1:int):
265+
async def setnumber(ctx: ApplicationContext, arg1: int):
266266
if arg1 < 1: raise(discord.ext.commands.BadArgument)
267267
else:
268268
count[str(ctx.channel.id)] = arg1

0 commit comments

Comments
 (0)