From 10f048fabca05a3348ed597bdc72d691b34aaaa1 Mon Sep 17 00:00:00 2001 From: Conatum Date: Sun, 7 Nov 2021 03:16:56 +0200 Subject: [PATCH 01/12] fix (rooms): Avoid loading rooms in dead guilds. --- bot/modules/accountability/TimeSlot.py | 16 ++++++++++------ bot/modules/accountability/tracker.py | 17 +++++++++-------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/bot/modules/accountability/TimeSlot.py b/bot/modules/accountability/TimeSlot.py index ac12efea..2a87826a 100644 --- a/bot/modules/accountability/TimeSlot.py +++ b/bot/modules/accountability/TimeSlot.py @@ -218,6 +218,9 @@ class TimeSlot: """ Load data and update applicable caches. """ + if not self.guild: + return self + # Load setting data self.category = GuildSettings(self.guild.id).accountability_category.value self.lobby = GuildSettings(self.guild.id).accountability_lobby.value @@ -389,13 +392,14 @@ class TimeSlot: pass # Reward members appropriately - guild_settings = GuildSettings(self.guild.id) - reward = guild_settings.accountability_reward.value - if all(mem.has_attended for mem in self.members.values()): - reward += guild_settings.accountability_bonus.value + if self.guild: + guild_settings = GuildSettings(self.guild.id) + reward = guild_settings.accountability_reward.value + if all(mem.has_attended for mem in self.members.values()): + reward += guild_settings.accountability_bonus.value - for memid in self.members: - Lion.fetch(self.guild.id, memid).addCoins(reward) + for memid in self.members: + Lion.fetch(self.guild.id, memid).addCoins(reward) async def cancel(self): """ diff --git a/bot/modules/accountability/tracker.py b/bot/modules/accountability/tracker.py index 51713230..24e1dc94 100644 --- a/bot/modules/accountability/tracker.py +++ b/bot/modules/accountability/tracker.py @@ -374,14 +374,15 @@ async def _accountability_system_resume(): None, mow.slotid, mow.userid) for mow in slot_members[row.slotid] if mow.last_joined_at ) - slot = TimeSlot(client.get_guild(row.guildid), row.start_at, data=row).load( - memberids=[mow.userid for mow in slot_members[row.slotid]] - ) + if client.get_guild(row.guildid): + slot = TimeSlot(client.get_guild(row.guildid), row.start_at, data=row).load( + memberids=[mow.userid for mow in slot_members[row.slotid]] + ) + try: + await slot.close() + except discord.HTTPException: + pass row.closed_at = now - try: - await slot.close() - except discord.HTTPException: - pass # Load the in-progress room data if current_room_data: @@ -451,7 +452,7 @@ async def launch_accountability_system(client): guilds = tables.guild_config.fetch_rows_where( accountability_category=NOTNULL ) - [AccountabilityGuild(guild.guildid) for guild in guilds] + [AccountabilityGuild(guild.guildid) for guild in guilds if client.get_guild(guild.guildid)] await _accountability_system_resume() asyncio.create_task(_accountability_loop()) From 0e62ebdb2b54e7f14feede7e63e6225db01e70e4 Mon Sep 17 00:00:00 2001 From: Conatum Date: Sun, 7 Nov 2021 14:58:57 +0200 Subject: [PATCH 02/12] fix (rroles): Increase maximum role price. --- bot/modules/guild_admin/reaction_roles/settings.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bot/modules/guild_admin/reaction_roles/settings.py b/bot/modules/guild_admin/reaction_roles/settings.py index b678b804..dbb4b8cf 100644 --- a/bot/modules/guild_admin/reaction_roles/settings.py +++ b/bot/modules/guild_admin/reaction_roles/settings.py @@ -199,6 +199,7 @@ class price(setting_types.Integer, ReactionSetting): ) accepts = "An integer number of coins. Use `0` to make the role free, or `None` to use the message default." + _max = 2 ** 20 @property def default(self): From 4c21160b31eb669df2b420fd861f9740ac3c26b8 Mon Sep 17 00:00:00 2001 From: Conatum Date: Sun, 7 Nov 2021 15:00:04 +0200 Subject: [PATCH 03/12] fix (rroles): Repair setting error reply. Modified `error_reply` utility so `kwargs` are passed to `Embed`. Added `send_args` kwarg to `error_reply`. Fixed an rroles issue where `UserInputError` handling would fail. --- bot/modules/guild_admin/reaction_roles/command.py | 6 +++--- bot/utils/ctx_addons.py | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/bot/modules/guild_admin/reaction_roles/command.py b/bot/modules/guild_admin/reaction_roles/command.py index 61e4a1ed..7f460262 100644 --- a/bot/modules/guild_admin/reaction_roles/command.py +++ b/bot/modules/guild_admin/reaction_roles/command.py @@ -821,8 +821,8 @@ async def cmd_reactionroles(ctx, flags): setting = await setting_class.parse(target.messageid, ctx, flags[flag]) except UserInputError as e: return await ctx.error_reply( - title="Couldn't save settings!", - description="{} {}\nNo settings were modified.".format(cross, e.msg) + "{} {}\nNo settings were modified.".format(cross, e.msg), + title="Couldn't save settings!" ) else: update_lines.append( @@ -861,8 +861,8 @@ async def cmd_reactionroles(ctx, flags): setting = await setting_class.parse(reaction.reactionid, ctx, flags[flag]) except UserInputError as e: return await ctx.error_reply( + "{} {}\nNo reaction roles were modified.".format(cross, e.msg), title="Couldn't save reaction role settings!", - description="{} {}\nNo reaction roles were modified.".format(cross, e.msg) ) else: update_lines.append( diff --git a/bot/utils/ctx_addons.py b/bot/utils/ctx_addons.py index 931422d9..9697eeec 100644 --- a/bot/utils/ctx_addons.py +++ b/bot/utils/ctx_addons.py @@ -26,21 +26,22 @@ async def embed_reply(ctx, desc, colour=discord.Colour.orange(), **kwargs): @Context.util -async def error_reply(ctx, error_str, **kwargs): +async def error_reply(ctx, error_str, send_args={}, **kwargs): """ Notify the user of a user level error. Typically, this will occur in a red embed, posted in the command channel. """ embed = discord.Embed( colour=discord.Colour.red(), - description=error_str + description=error_str, + **kwargs ) message = None try: message = await ctx.ch.send( embed=embed, reference=ctx.msg.to_reference(fail_if_not_exists=False), - **kwargs + **send_args ) ctx.sent_messages.append(message) return message From db6cc078db4d36ba7af2b25208cc1bdab215819a Mon Sep 17 00:00:00 2001 From: Conatum Date: Sun, 7 Nov 2021 15:05:05 +0200 Subject: [PATCH 04/12] fix (rroles): Off by one error in `maximum`. --- bot/modules/guild_admin/reaction_roles/tracker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/modules/guild_admin/reaction_roles/tracker.py b/bot/modules/guild_admin/reaction_roles/tracker.py index 6d130263..f18e3c34 100644 --- a/bot/modules/guild_admin/reaction_roles/tracker.py +++ b/bot/modules/guild_admin/reaction_roles/tracker.py @@ -272,7 +272,7 @@ class ReactionRoleMessage: # Fetch the number of applicable roles the user has roleids = set(reaction.data.roleid for reaction in self.reactions) member_roleids = set(role.id for role in member.roles) - if len(roleids.intersection(member_roleids)) > maximum: + if len(roleids.intersection(member_roleids)) >= maximum: # Notify the user embed = discord.Embed( title="Maximum group roles reached!", From e797b67c3b12375d519791197fcb82ff40aa3680 Mon Sep 17 00:00:00 2001 From: Conatum Date: Sun, 7 Nov 2021 15:09:06 +0200 Subject: [PATCH 05/12] fix (rooms): Remove `speak` permission from room. --- bot/modules/accountability/TimeSlot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bot/modules/accountability/TimeSlot.py b/bot/modules/accountability/TimeSlot.py index 2a87826a..9464e4e5 100644 --- a/bot/modules/accountability/TimeSlot.py +++ b/bot/modules/accountability/TimeSlot.py @@ -69,7 +69,8 @@ class TimeSlot: _everyone_overwrite = discord.PermissionOverwrite( view_channel=False, - connect=False + connect=False, + speak=False ) happy_lion = "https://media.discordapp.net/stickers/898266283559227422.png" From 0fbf7c8903fac61edfe9a3febb5a3635bff2424e Mon Sep 17 00:00:00 2001 From: Conatum Date: Sun, 7 Nov 2021 15:23:14 +0200 Subject: [PATCH 06/12] fix (seekers): Consider news channels as text. Non-canonical hack to `find_channel` to include `news` types in `text`. --- bot/modules/guild_admin/reaction_roles/command.py | 2 +- bot/utils/seekers.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bot/modules/guild_admin/reaction_roles/command.py b/bot/modules/guild_admin/reaction_roles/command.py index 7f460262..0f915ffa 100644 --- a/bot/modules/guild_admin/reaction_roles/command.py +++ b/bot/modules/guild_admin/reaction_roles/command.py @@ -485,7 +485,7 @@ async def cmd_reactionroles(ctx, flags): await ctx.error_reply( "The provided channel no longer exists!" ) - elif channel.type != discord.ChannelType.text: + elif not isinstance(channel, discord.TextChannel): await ctx.error_reply( "The provided channel is not a text channel!" ) diff --git a/bot/utils/seekers.py b/bot/utils/seekers.py index 69bb1f46..7f3d49d3 100644 --- a/bot/utils/seekers.py +++ b/bot/utils/seekers.py @@ -182,7 +182,11 @@ async def find_channel(ctx, userstr, interactive=False, collection=None, chan_ty # Create the collection to search from args or guild channels collection = collection if collection else ctx.guild.channels if chan_type is not None: - collection = [chan for chan in collection if chan.type == chan_type] + if chan_type == discord.ChannelType.text: + # Hack to support news channels as text channels + collection = [chan for chan in collection if isinstance(chan, discord.TextChannel)] + else: + collection = [chan for chan in collection if chan.type == chan_type] # If the user input was a number or possible channel mention, extract it chanid = userstr.strip('<#@&!>') @@ -413,7 +417,7 @@ async def find_message(ctx, msgid, chlist=None, ignore=[]): async def _search_in_channel(channel: discord.TextChannel, msgid: int): - if channel.type != discord.ChannelType.text: + if not isinstance(channel, discord.TextChannel): return try: message = await channel.fetch_message(msgid) From 0b5be79b6954f6615fca7e06ce52d76164b2bfda Mon Sep 17 00:00:00 2001 From: Conatum Date: Sun, 7 Nov 2021 16:12:35 +0200 Subject: [PATCH 07/12] (LionModule): Improve startup handling. Update `cmdClient` pointer for module launch updates. Implement module launch wait logic in `pre_command`. Add details to `SafeCancellation` calls in `pre_command`. --- bot/LionModule.py | 25 +++++++++++++++++++------ bot/cmdClient | 2 +- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/bot/LionModule.py b/bot/LionModule.py index 2d6fb854..c1fd7256 100644 --- a/bot/LionModule.py +++ b/bot/LionModule.py @@ -13,7 +13,7 @@ class LionCommand(Command): """ Subclass to allow easy attachment of custom hooks and structure to commands. """ - ... + allow_before_ready = False class LionModule(Module): @@ -72,25 +72,38 @@ class LionModule(Module): """ Lion pre-command hook. """ + if not self.ready and not ctx.cmd.allow_before_ready: + try: + await ctx.embed_reply( + "I am currently restarting! Please try again in a couple of minutes." + ) + except discord.HTTPException: + pass + raise SafeCancellation(details="Module '{}' is not ready.".format(self.name)) + + # Check that the channel and guild still exists + if not ctx.client.get_guild(ctx.guild.id) or not ctx.guild.get_channel(ctx.ch.id): + raise SafeCancellation(details='Command channel is no longer reachable.') + # Check global user blacklist if ctx.author.id in ctx.client.objects['blacklisted_users']: - raise SafeCancellation + raise SafeCancellation(details='User is blacklisted.') if ctx.guild: # Check global guild blacklist if ctx.guild.id in ctx.client.objects['blacklisted_guilds']: - raise SafeCancellation + raise SafeCancellation(details='Guild is blacklisted.') # Check guild's own member blacklist if ctx.author.id in ctx.client.objects['ignored_members'][ctx.guild.id]: - raise SafeCancellation + raise SafeCancellation(details='User is ignored in this guild.') # Check channel permissions are sane if not ctx.ch.permissions_for(ctx.guild.me).send_messages: - raise SafeCancellation + raise SafeCancellation(details='I cannot send messages in this channel.') if not ctx.ch.permissions_for(ctx.guild.me).embed_links: await ctx.reply("I need permission to send embeds in this channel before I can run any commands!") - raise SafeCancellation + raise SafeCancellation(details='I cannot send embeds in this channel.') # Start typing await ctx.ch.trigger_typing() diff --git a/bot/cmdClient b/bot/cmdClient index 75410acc..6eb42690 160000 --- a/bot/cmdClient +++ b/bot/cmdClient @@ -1 +1 @@ -Subproject commit 75410acc120b456ff315ff468357b6fb22a0a406 +Subproject commit 6eb426903423d6be8439621eb0b906aa94957efd From fc3246913fb9c1a6be285af9b2eb906438dac90b Mon Sep 17 00:00:00 2001 From: Conatum Date: Sun, 7 Nov 2021 16:27:38 +0200 Subject: [PATCH 08/12] fix (core): Update `guild_config` definition. Increase the cache size, and update the columns. --- bot/core/data.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bot/core/data.py b/bot/core/data.py index c33914d7..992e9ab5 100644 --- a/bot/core/data.py +++ b/bot/core/data.py @@ -53,13 +53,19 @@ def add_pending(pending): guild_config = RowTable( 'guild_config', - ('guildid', 'admin_role', 'mod_role', 'event_log_channel', 'alert_channel', + ('guildid', 'admin_role', 'mod_role', 'event_log_channel', 'mod_log_channel', 'alert_channel', + 'studyban_role', 'min_workout_length', 'workout_reward', 'max_tasks', 'task_reward', 'task_reward_limit', 'study_hourly_reward', 'study_hourly_live_bonus', - 'study_ban_role', 'max_study_bans'), + 'renting_price', 'renting_category', 'renting_cap', 'renting_role', 'renting_sync_perms', + 'accountability_category', 'accountability_lobby', 'accountability_bonus', + 'accountability_reward', 'accountability_price', + 'video_studyban', 'video_grace_period', + 'greeting_channel', 'greeting_message', 'returning_message', + 'starting_funds', 'persist_roles'), 'guildid', - cache=TTLCache(1000, ttl=60*5) + cache=TTLCache(2500, ttl=60*5) ) unranked_roles = Table('unranked_roles') @@ -72,6 +78,7 @@ lions = RowTable( ('guildid', 'userid', 'tracked_time', 'coins', 'workout_count', 'last_workout_start', + 'revision_mute_count', 'last_study_badgeid', 'video_warned', '_timestamp' From 2cf66ab6004ae347f9a85dd572e43632eeb5f2d7 Mon Sep 17 00:00:00 2001 From: Conatum Date: Sun, 7 Nov 2021 16:31:55 +0200 Subject: [PATCH 09/12] (stats_cmd): Allow execution before ready. --- bot/modules/study/stats_cmd.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bot/modules/study/stats_cmd.py b/bot/modules/study/stats_cmd.py index 90768202..73604658 100644 --- a/bot/modules/study/stats_cmd.py +++ b/bot/modules/study/stats_cmd.py @@ -12,7 +12,8 @@ from .module import module @module.cmd( "stats", group="Statistics", - desc="View a summary of your study statistics!" + desc="View a summary of your study statistics!", + allow_before_ready=True ) @in_guild() async def cmd_stats(ctx): From 6bc831a5497e8b23cc59ef17bf95bf181b30aebe Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Thu, 11 Nov 2021 19:11:37 +0530 Subject: [PATCH 10/12] Added standard .gitignore for project Standard python .gitignore: https://github.com/github/gitignore/blob/master/Python.gitignore and to ignore changes to `config/**` dir (hiding bot.conf file) --- .gitignore | 140 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..978964e7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,140 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +config/** \ No newline at end of file From d529daaa27e7f3d7b4e712bee26215f60638a122 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 6 Dec 2021 19:14:47 +0530 Subject: [PATCH 11/12] [Guild_Admin] set_coins Admin command --- bot/modules/guild_admin/__init__.py | 1 + bot/modules/guild_admin/economy/__init__.py | 3 + bot/modules/guild_admin/economy/set_coins.py | 104 +++++++++++++++++++ 3 files changed, 108 insertions(+) create mode 100644 bot/modules/guild_admin/economy/__init__.py create mode 100644 bot/modules/guild_admin/economy/set_coins.py diff --git a/bot/modules/guild_admin/__init__.py b/bot/modules/guild_admin/__init__.py index 74d5644d..2c4f3922 100644 --- a/bot/modules/guild_admin/__init__.py +++ b/bot/modules/guild_admin/__init__.py @@ -4,3 +4,4 @@ from . import guild_config from . import statreset from . import new_members from . import reaction_roles +from . import economy diff --git a/bot/modules/guild_admin/economy/__init__.py b/bot/modules/guild_admin/economy/__init__.py new file mode 100644 index 00000000..2714bcdb --- /dev/null +++ b/bot/modules/guild_admin/economy/__init__.py @@ -0,0 +1,3 @@ +from ..module import module + +from . import set_coins \ No newline at end of file diff --git a/bot/modules/guild_admin/economy/set_coins.py b/bot/modules/guild_admin/economy/set_coins.py new file mode 100644 index 00000000..d74651a9 --- /dev/null +++ b/bot/modules/guild_admin/economy/set_coins.py @@ -0,0 +1,104 @@ +import discord +import datetime +from cmdClient.checks import in_guild + +from settings import GuildSettings +from core import Lion + +from ..module import module + +POSTGRES_INT_MAX = 2147483647 + +@module.cmd( + "set_coins", + group="Guild Admin", + desc="Set coins on a member." +) +@in_guild() +async def cmd_set(ctx): + """ + Usage``: + {prefix}set_coins + Description: + Sets the given number of coins on the mentioned user. + If a number greater than 0 is mentioned, will add coins. + If a number less than 0 is mentioned, will remove coins. + Note: LionCoins on a member cannot be negative. + Example: + {prefix}set_coins {ctx.author.mention} 100 + {prefix}set_coins {ctx.author.mention} -100 + """ + # Extract target and amount + # Handle a slightly more flexible input than stated + splits = ctx.args.split() + digits = [isNumber(split) for split in splits[:2]] + mentions = ctx.msg.mentions + if len(splits) < 2 or not any(digits) or not (all(digits) or mentions): + return await _send_usage(ctx) + + if all(digits): + # Both are digits, hopefully one is a member id, and one is an amount. + target, amount = ctx.guild.get_member(int(splits[0])), int(splits[1]) + if not target: + amount, target = int(splits[0]), ctx.guild.get_member(int(splits[1])) + if not target: + return await _send_usage(ctx) + elif digits[0]: + amount, target = int(splits[0]), mentions[0] + elif digits[1]: + target, amount = mentions[0], int(splits[1]) + + # Fetch the associated lion + target_lion = Lion.fetch(ctx.guild.id, target.id) + + # Check sanity conditions + if target == ctx.client.user: + return await ctx.embed_reply("Thanks, but Ari looks after all my needs!") + if target.bot: + return await ctx.embed_reply("We are still waiting for {} to open an account.".format(target.mention)) + + # Finally, send the amount and the ack message + # Postgres `coins` column is `integer`, sanity check postgres int limits - which are smalled than python int range + target_coins_to_set = target_lion.coins + amount + if target_coins_to_set >= 0 and target_coins_to_set <= POSTGRES_INT_MAX: + target_lion.addCoins(amount) + elif target_coins_to_set < 0: + target_coins_to_set = -target_lion.coins # Coins cannot go -ve, cap to 0 + target_lion.addCoins(target_coins_to_set) + target_coins_to_set = 0 + else: + return await ctx.embed_reply("Member coins cannot be more than {}".format(POSTGRES_INT_MAX)) + + embed = discord.Embed( + title="Funds Set", + description="You have set LionCoins on {} to **{}**!".format(target.mention,target_coins_to_set), + colour=discord.Colour.orange(), + timestamp=datetime.datetime.utcnow() + ).set_footer(text=str(ctx.author), icon_url=ctx.author.avatar_url) + + await ctx.reply(embed=embed, reference=ctx.msg) + GuildSettings(ctx.guild.id).event_log.log( + "{} set {}'s LionCoins to`{}`.".format( + ctx.author.mention, + target.mention, + target_coins_to_set + ), + title="Funds Set" + ) + +def isNumber(var): + try: + return isinstance(int(var), int) + except: + return False + +async def _send_usage(ctx): + return await ctx.error_reply( + "**Usage:** `{prefix}set_coins `\n" + "**Example:**\n" + " {prefix}set_coins {ctx.author.mention} 100\n" + " {prefix}set_coins {ctx.author.mention} -100".format( + prefix=ctx.best_prefix, + ctx=ctx + ) + ) From 4582d9a1a10391cc1be4381fbfb204d9d1bdc0d8 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 6 Dec 2021 19:50:28 +0530 Subject: [PATCH 12/12] Implement proper check for admin --- bot/modules/guild_admin/economy/set_coins.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/modules/guild_admin/economy/set_coins.py b/bot/modules/guild_admin/economy/set_coins.py index d74651a9..c0744a13 100644 --- a/bot/modules/guild_admin/economy/set_coins.py +++ b/bot/modules/guild_admin/economy/set_coins.py @@ -1,6 +1,6 @@ import discord import datetime -from cmdClient.checks import in_guild +from wards import guild_admin from settings import GuildSettings from core import Lion @@ -14,7 +14,7 @@ POSTGRES_INT_MAX = 2147483647 group="Guild Admin", desc="Set coins on a member." ) -@in_guild() +@guild_admin() async def cmd_set(ctx): """ Usage``: