|
|
@@ -147,6 +147,7 @@ class CogSetting:
|
|
147
|
147
|
async def getter(interaction: Interaction) -> None:
|
|
148
|
148
|
key = f'{cog.__class__.__name__}.{setting.name}'
|
|
149
|
149
|
value = setting.to_native_value(Storage.get_config_value(interaction.guild, key))
|
|
|
150
|
+ cog.log(interaction.guild, f'{interaction.user.name} used /get setting_name')
|
|
150
|
151
|
if value is None:
|
|
151
|
152
|
value = setting.to_native_value(cog.get_cog_default(setting.name))
|
|
152
|
153
|
await interaction.response.send_message(
|
|
|
@@ -179,6 +180,7 @@ class CogSetting:
|
|
179
|
180
|
if cog.config_prefix is not None:
|
|
180
|
181
|
setting_name = f'{cog.config_prefix}_{setting_name}'
|
|
181
|
182
|
async def setter_general(interaction: Interaction, new_value) -> None:
|
|
|
183
|
+ cog.log(interaction.guild, f'{interaction.user.name} used /set setting_name {new_value}')
|
|
182
|
184
|
try:
|
|
183
|
185
|
setting.validate_value(new_value)
|
|
184
|
186
|
except ValueError as ve:
|
|
|
@@ -194,7 +196,6 @@ class CogSetting:
|
|
194
|
196
|
ephemeral=True
|
|
195
|
197
|
)
|
|
196
|
198
|
await cog.on_setting_updated(interaction.guild, setting)
|
|
197
|
|
- cog.log(interaction.guild, f'{interaction.user.name} set {key} to {new_value}')
|
|
198
|
199
|
|
|
199
|
200
|
setter: CommandCallback = setter_general
|
|
200
|
201
|
if self.datatype is int:
|
|
|
@@ -273,7 +274,7 @@ class CogSetting:
|
|
273
|
274
|
ephemeral=True
|
|
274
|
275
|
)
|
|
275
|
276
|
await cog.on_setting_updated(interaction.guild, setting)
|
|
276
|
|
- cog.log(interaction.guild, f'{interaction.user.name} enabled {cog.__class__.__name__}')
|
|
|
277
|
+ cog.log(interaction.guild, f'{interaction.user.name} used /enable {cog.__class__.__name__}')
|
|
277
|
278
|
|
|
278
|
279
|
bot_log(None, cog.__class__, f"Creating command: /enable {cog.config_prefix}")
|
|
279
|
280
|
command = Command(
|
|
|
@@ -299,7 +300,7 @@ class CogSetting:
|
|
299
|
300
|
ephemeral=True
|
|
300
|
301
|
)
|
|
301
|
302
|
await cog.on_setting_updated(interaction.guild, setting)
|
|
302
|
|
- cog.log(interaction.guild, f'{interaction.user.name} disabled {cog.__class__.__name__}')
|
|
|
303
|
+ cog.log(interaction.guild, f'{interaction.user.name} used /disable {cog.__class__.__name__}')
|
|
303
|
304
|
|
|
304
|
305
|
bot_log(None, cog.__class__, f"Creating command: /disable {cog.config_prefix}")
|
|
305
|
306
|
command = Command(
|
|
|
@@ -385,6 +386,7 @@ class CogSetting:
|
|
385
|
386
|
from rocketbot.cogs.basecog import BaseCog
|
|
386
|
387
|
async def show_all(interaction: Interaction) -> None:
|
|
387
|
388
|
try:
|
|
|
389
|
+ bot_log(interaction.guild, None, f'{interaction.user.name} used /get all')
|
|
388
|
390
|
guild = interaction.guild
|
|
389
|
391
|
if guild is None:
|
|
390
|
392
|
await interaction.response.send_message(
|