Send a message when the values are changed
This commit is contained in:
parent
47d8195465
commit
5841c4a4a6
13
bot.py
13
bot.py
@ -140,22 +140,29 @@ class Bot(commands.Bot):
|
||||
|
||||
@commands.command(name='config')
|
||||
async def modify_config(self, ctx):
|
||||
# TODO: Check if user is the streamer or mod
|
||||
# Check if user is the streamer or mod
|
||||
# Get the values from the message
|
||||
if ctx.author.name.lower() == ctx.channel.name.lower() or ctx.author.badges == 'moderator':
|
||||
print('[OK] Correct credentials to modify the config.')
|
||||
print('{}'.format(ctx.message.content))
|
||||
config_message = ctx.message.content.replace('\U000e0000', '').split()
|
||||
print(config_message)
|
||||
if len(config_message) == 3:
|
||||
if config_message[1] == 'water':
|
||||
self.default_values['water_limit'] = int(config_message[2])
|
||||
save_config_file(self.default_values)
|
||||
print(' - Water limit message modified to: {}'.format(config_message[2]))
|
||||
elif config_message[1] == 'prime':
|
||||
self.default_values['prime_spam_limit'] = int(config_message[2])
|
||||
save_config_file(self.default_values)
|
||||
print(' - Prime limit message modified to: {}'.format(config_message[2]))
|
||||
|
||||
await ctx.channel.send('Veeenga, modifico el número de mensajes que me pides.')
|
||||
else:
|
||||
await ctx.channel.send('@{} Jefe, faltan parámetros para la configuración.'.format(ctx.author.display_name))
|
||||
else:
|
||||
await ctx.channel.send('@{} Lo siento, pero tú no tienes poder aquí. Pídeselo a algún moderador o @jkuijperm'.format(ctx.author.display_name))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user