rf: message sending
This commit is contained in:
parent
5c4729a284
commit
6d4f0d7e8d
1 changed files with 10 additions and 3 deletions
13
main.py
13
main.py
|
@ -4,7 +4,14 @@ from configparser import ConfigParser
|
|||
|
||||
# Bot token (replace with your own)
|
||||
TOKEN = 'MTE1NDc0ODQ3MzE4MzMwNTc4OQ.Gz_Q7u.02sb2YNV_QQy7Bs19roXlB62mjoMKA6y8aubHU'
|
||||
# Iterate over the sections in the config file
|
||||
|
||||
|
||||
async def reply_error(ctx: commands.Context, message: str):
|
||||
await reply(ctx, f'**Error:** {message}', True)
|
||||
|
||||
|
||||
async def reply(ctx: commands.Context, message: str):
|
||||
await ctx.send(message)
|
||||
|
||||
|
||||
def get_server_IDs():
|
||||
|
@ -60,9 +67,9 @@ async def grant_role(ctx, study_group_name: str):
|
|||
|
||||
if role is not None:
|
||||
await author.add_roles(role)
|
||||
await ctx.send(f'{author.mention} has been granted the {study_group_name} role on server {guild.name}.')
|
||||
await reply(ctx, f'{author.mention} has been granted the {study_group_name} role on the [{guild.name}] server.')
|
||||
return
|
||||
await ctx.send('Something gone wrong. Please check your command and try again.')
|
||||
await reply_error(ctx, 'Something went wrong. Please check your command and try again.')
|
||||
return
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue