async def set_quote_channel(self, ctx: Context, channel: TextChannelConverter()): """ Sets the quotes channel. """ self.quote_channel = channel await ctx.send("Quotes channel successfully set.")
async def convert(self, ctx: Context, argument): if isinstance(argument, Deck): return argument deck_handler = DeckHandler(ctx.bot) if not deck_handler.ready: raise CommandError('deck handler is not ready') deck = deck_handler.get_deck_by_id(argument) if deck is not None: return deck deck = deck_handler.get_deck_by_name(argument) if deck is not None: return deck async def convert_with(converter: Converter): try: return await converter.convert(ctx, argument) except BadArgument: pass channel = await convert_with(TextChannelConverter()) if channel is None: channel = await convert_with(VoiceChannelConverter()) if channel is None: channel = await convert_with(CategoryChannelConverter()) if channel is not None: deck = deck_handler.get_deck_by_channel(channel) if deck is not None: return deck raise BadArgument( message=f'cannot convert argument "{argument}" to deck')
async def moderation_config(self, ctx): mod_channel = None if fetch_mod_log_channel(int(ctx.guild.id)) is not None: mod_channel = fetch_mod_log_channel(int( ctx.guild.id))["channel_id"] mod_channel = self.bot.get_channel(mod_channel) embed = discord.Embed( title='Server config', description= 'Type out the channel for moderation logs\nType `none` to delete pre-existing logging\n\n' f'Current moderation logs channel - {mod_channel.mention if mod_channel is not None else mod_channel}\n\n' '**Note: Config will timeout in 1 minute**', colour=0x008000) sent1 = await ctx.send(embed=embed) try: msg1 = await self.bot.wait_for( "message", check=lambda message: message.author == ctx.author and message. channel == ctx.message.channel, timeout=60) if msg1: if msg1.content.lower() == 'none': done1 = await ctx.send( 'removed the moderation logging channel, if it exists') delete_mod_log_channel(int(ctx.guild.id)) else: converter = TextChannelConverter() new_channel = await converter.convert( ctx, f'{msg1.content}') done1 = await ctx.send( f"{new_channel.mention} has been made the moderation logging channel successfully" ) insert_mod_log_channel(int(ctx.guild.id), int(new_channel.id)) return sent1, msg1, done1 except asyncio.TimeoutError: await sent1.delete() embed = discord.Embed( title='Server config', description= 'Cancelling server configuration due to timeout\nPrevious entries were logged', colour=0xff0000) await ctx.send(embed=embed) return None, None, None
async def try_silence(self, ctx: Context) -> bool: """ Attempt to invoke the silence or unsilence command if invoke with matches a pattern. Respecting the checks if: * invoked with `shh+` silence channel for amount of h's*2 with max of 15. * invoked with `unshh+` unsilence channel Return bool depending on success of command. """ command = ctx.invoked_with.lower() args = ctx.message.content.lower().split(" ") silence_command = self.bot.get_command("silence") ctx.invoked_from_error_handler = True try: if not await silence_command.can_run(ctx): log.debug( "Cancelling attempt to invoke silence/unsilence due to failed checks." ) return False except errors.CommandError: log.debug( "Cancelling attempt to invoke silence/unsilence due to failed checks." ) return False # Parse optional args channel = None duration = min(command.count("h") * 2, 15) kick = False if len(args) > 1: # Parse channel for converter in (TextChannelConverter(), VoiceChannelConverter()): try: channel = await converter.convert(ctx, args[1]) break except ChannelNotFound: continue if len(args) > 2 and channel is not None: # Parse kick kick = args[2].lower() == "true" if command.startswith("shh"): await ctx.invoke(silence_command, duration_or_channel=channel, duration=duration, kick=kick) return True elif command.startswith("unshh"): await ctx.invoke(self.bot.get_command("unsilence"), channel=channel) return True return False
async def chatlog(ctx, *, channel: commands.TextChannelConverter = None): """ Get chat log """ import io import zlib if channel is None: channel = ctx.channel compress = zlib.compressobj(level=9, wbits=zlib.MAX_WBITS + 16) log = bytearray() msgcount = 0 charcount = 0 logcount = 0 pending = await ctx.send("pending...") async with ctx.channel.typing(): async for msg in channel.history(limit=None, oldest_first=True): created = msg.created_at.strftime("%y-%m-%d %H:%M:%S") line = f"[{created}] {msg.author}: {msg.clean_content}" if msg.attachments: filelist = ", ".join(f"{f.filename}:{f.url}" for f in msg.attachments) line += f" [attached: {filelist}]" if msg.embeds: plural = "s" if len(msg.embeds) > 1 else "" line += f" [{len(msg.embeds)} embed{plural}]" encoded = (line + "\n").encode() log += compress.compress(encoded) msgcount += 1 charcount += len(msg.content) logcount += len(encoded) if msgcount % 500 == 0: await pending.edit( content=f"{msgcount} processed, up to {created}", suppress=False) log += compress.flush() await pending.delete() msg = await ctx.send( f"{ctx.author.mention} {charcount} characters across {msgcount} messages. " f"Log {logcount//1000} kb long, compressed to {len(log)//1000} kb", file=discord.File(io.BytesIO(log), filename=f"{channel.guild.name}--{channel.name}.gz")) await ctx.author.send(f"chatlog done -> {msg.jump_url}")
async def convert(cls, ctx: commands.Context, argument: str) -> discord.TextChannel: converter = TextChannelConverter() channel = await converter.convert(ctx, argument) my_perms = channel.permissions_for(ctx.me) if not (my_perms.send_messages and my_perms.embed_links): raise BadArgument( f"I do not have permissions to send embeds in {channel.mention}." ) author_perms = channel.permissions_for(ctx.author) if not (author_perms.send_messages and author_perms.embed_links): raise BadArgument( f"You do not have permissions to send embeds in {channel.mention}." ) return channel
async def channel(self, ctx, *, channel_name: str): """ Set the channel for lyrics to be sent to Note: to reset default channel to DMs enter dms """ guild = ctx.guild if channel_name.lower() != "dms": try: channelObj = await (TextChannelConverter()).convert(ctx, channel_name) except commands.BadArgument: return await ctx.send("Couldn't find that channel.") if channel_name.lower() == "dms": await self.config.guild(guild).channel.set(None) await ctx.send("Lyrics will now be sent to DMs") else: await self.config.guild(guild).channel.set(channelObj.id) await ctx.send(f"Lyrics will now be sent to {channelObj.mention}")
async def logchannel(self, ctx, channel: str = None): if channel is not None: if channel.lower() in ["-1", "none", "off"]: await dbcontrol.modify_setting(ctx.guild.id, "logchannel", None) return await ctx.send( ":white_check_mark: **Log channel successfully turned off**" ) converter = TextChannelConverter() channel = await converter.convert(ctx, channel) await dbcontrol.modify_setting(ctx.guild.id, "logchannel", channel.id) await ctx.send( f":white_check_mark: **Log channel set to ``{channel.name}``**" ) else: chan = await dbcontrol.get_setting(ctx.guild.id, 'logchannel') channel = ctx.guild.get_channel(chan) await ctx.send(f"**The current log channel is ``{channel.name}``**" if chan else ":x: **No log channel found**")
async def scheduleping(self, ctx: Context, channel: TextChannelConverter = None, scanlimit: int = None): """Scan the last successful bump throughout the current channel and schedule a ping to do after remaining time if available. Scan is performed to <scanlimit> amount of messages in <channel> text channel only if they are specified.""" if ctx.guild.id not in self.bump_roles: await ctx.send("No bumper role was set to notify") return bump_time = None channel = ctx.channel if channel is None else channel async for msg in channel.history(limit=scanlimit): if self.is_successful_bump(msg): bump_time = msg.created_at break # discard everything else if bump_time is None: await ctx.send("Scan revealed no successful bump") time_diff = datetime.utcnow() - bump_time if time_diff >= timedelta(hours=2): self.ping_target(ctx.channel) else: delay = timedelta(hours=2) - time_diff self.loop.call_later(delay.total_seconds(), self.ping_target, ctx.channel) await ctx.send( strfdelta( delay, "Ping scheduled to be called %H hrs %M min %S secs later"))
async def register_role(self, ctx, role: discord.Role, *channels): """ Activate no-command subscription for the specified role. If any channels are specified after the role, they're registered as channels that this role enables you to see. :param ctx: :return: """ guild_settings = self.db.get_no_command_subscription_settings( ctx.guild) if guild_settings is None: await ctx.message.channel.send( f'{ctx.author.mention} No-command subscription is not configured.' ) return channel_converter = TextChannelConverter() channel_list = [ await channel_converter.convert(ctx, raw_channel) for raw_channel in channels ] self.db.register_role(ctx.guild, role, channel_list) channel_str = "" if len(channel_list) > 0: channel_str = " This role is associated with channels:\n" for channel in channel_list: channel_str += f"\n - {channel}" reply = ( f'{ctx.author.mention} No-command subscription for role {role} has been ' f'configured with {ctx.guild.get_member(self.bot.user.id).name}.') reply += channel_str await ctx.message.channel.send(reply)
async def embedsend(self, ctx, *args): """Sends an embed message of choice in a channel of choice. Requires administrator. ```//embedsend <channel>```""" converter = TextChannelConverter() converter2 = RoleConverter() try: channel = await converter.convert(ctx, args[0]) except Exception: await ctx.send("Please input a channel.") return embed = discord.Embed(color=0xff0008) for x in count(1): embed_var = discord.Embed(color=0xff0008) embed_var.add_field( name="Name #" + str(x), value="Respond with the name of field #" + str(x) + ". If you are done type \"done\". If you would like to include a field with who sent this embed, " "type \"userstamp\". The message will then be sent. ", inline=False) q = await ctx.send(embed=embed_var) responsefound = False while not responsefound: async for message in ctx.channel.history(limit=10): if message.author == ctx.author and message.created_at > q.created_at: response = message responsefound = True break answer = response.content if answer == "done": break elif answer == "userstamp": embed.add_field(name="__Message Sent By__", value=ctx.author.mention, inline=False) break embed_var = discord.Embed(color=0xff0008) embed_var.add_field(name="Value #" + str(x), value="Respond with the name of field #" + str(x) + ".", inline=False) q = await ctx.send(embed=embed_var) responsefound = False while not responsefound: async for message in ctx.channel.history(limit=10): if message.author == ctx.author and message.created_at > q.created_at: response = message responsefound = True break answer2 = response.content embed.add_field(name=answer, value=answer2 + "\n", inline=False) try: if args[1] == "everyone": await channel.send("@everyone\n", embed=embed) elif args[1] == "here": await channel.send("@here\n", embed=embed) else: rolemention = await converter2.convert(ctx, args[1]) await channel.send(rolemention.mention + "\n", embed=embed) except Exception: await channel.send(embed=embed) await ctx.send("Message sent!")
async def join_log_config(self, ctx): join_channel = None if fetch_join_log_channel(int(ctx.guild.id)) is not None: join_channel = fetch_join_log_channel(int( ctx.guild.id))["channel_id"] join_channel = self.bot.get_channel(join_channel) embed = discord.Embed( title='Server Config', description= 'Type out the channel for logging when a member joins\nType `none` to delete pre-existing logging\n\n' f'Current Joins logging channel - {join_channel.mention if join_channel is not None else join_channel}\n\n' 'NB: It would be better if you make it a private logging channel\n' '**Note: Config will timeout in a minute**', colour=0x008000) sent2 = await ctx.send(embed=embed) try: msg2 = await self.bot.wait_for( "message", check=lambda message: message.author == ctx.author and message. channel == ctx.message.channel, timeout=60) if msg2: if msg2.content.lower() == 'none': done2 = await ctx.send( 'Removed the moderation join logging channel, if it exists' ) delete_join_log_channel(int(ctx.guild.id)) else: converter = TextChannelConverter() new_channel = await converter.convert( ctx, f'{msg2.content}') done2 = await ctx.send( f'{new_channel.mention} has been made the joins logging channel successfully' ) insert_join_log_channel(int(ctx.guild.id), int(new_channel.id)) return sent2, msg2, done2 except asyncio.TimeoutError: await sent2.delete() embed = discord.Embed( title='Server config', description= 'Cancelling server configuration due to timeout\nPrevious entries were logged', colour=0xff0000) await ctx.send(embed=embed) return None, None, None
from aethersprite.authz import channel_only, require_roles_from_setting from aethersprite.filters import RoleFilter from aethersprite.settings import register, settings #: messages MSG_NO_SETTING = ':person_shrugging: No such setting exists.' #: authorization decorator authz = partial(require_roles_from_setting, setting='settings.adminroles', open_by_default=False) #: Argument converter for optional channel argument by keyword channel_arg = ArgumentConverter( channel=OptionalArgument( TextChannel, 'The channel to use (if not this one)')) #: Converter for turning text into TextChannel objects chan_converter = TextChannelConverter() class Settings(Cog, name='settings'): """ Settings commands View settings, change settings, reset settings, and view settings descriptions. """ def __init__(self, bot): self.bot = bot @command() async def get(self, ctx, name: Optional[str] = None, *,
async def basic_setup(self, ctx): predicate = MessagePredicate.yes_or_no(ctx, ctx.channel, ctx.author) predicate1 = MessagePredicate.greater(0, ctx, ctx.channel, ctx.author) predicate2 = MessagePredicate.length_less(200, ctx, ctx.channel, ctx.author) question1 = "Would you like to setup Anti Mention Spam?" question2 = "Would you like the user to be banned when exceeding the max mentions?" question3 = ("Would you like to setup timed mention spam? " "(mentions from multiple messages in a set time)") question4 = "Would you like to setup an automatic role when a user joins?" question5 = ( "Would you like to setup bancheck, which checks new users against " "several databases to see if they have been banned?") question6 = "Would you like to set up the bots bank settings?" question7 = "Would you like to set up logs for things that happen in the server?" question8 = "Would you like to change the name of the casino?" question9 = ( "Would you like the bot to respond to messages when the bot " "is mentioned at the start of the message?") question10 = "Would you like to setup the dungeon?" question11 = "Would you like to setup the economy settings?" question12 = "Would you like to setup filtered words?" question13 = "Would you like to add a channel that shows the amount of users in the server?" question14 = ( "Would you like to add a channel that recieves a message when a " "user leaves the server?") question15 = "Would you like a channel for recieving lyrics when using the lyrics command?" question16 = "Would you like to setup basic auto mod features?" question17 = "Would you like to setup a mod log?" question18 = "Would you like to setup reports?" question19 = "Would you like to setup starboard?" question20 = "Would you like to setup tickets?" question21 = "Would you like to setup a welcome message for new users?" question22 = "Would you like to setup the mod and admin role?" question23 = "Would you like to setup reaction roles?" try: cog = self.bot.get_cog("AntiMentionSpam") if cog: if (await self._get_response(ctx, question1, predicate)).lower() == "yes": number = await self._get_response( ctx, "How many mentions from a single user in a single message " "should be acted upon?", predicate1, ) number = int(number) await ctx.invoke( ctx.bot.get_command("antimentionspam max"), number) await asyncio.sleep(1) autoban = await self._get_response(ctx, question2, predicate) == "yes" if autoban.lower() == "yes": await ctx.invoke( ctx.bot.get_command( "antimentionspam autobantoggle")) await asyncio.sleep(1) mentions = await self._get_response( ctx, question3, predicate) == "yes" if mentions.lower() == "yes": number = int(await self._get_response( ctx, "How many mentions?", predicate1)) await asyncio.sleep(0.5) number1 = int(await self._get_response(ctx, "In how many seconds?", predicate1)) await ctx.invoke( ctx.bot.get_command("antimentionspam maxinterval"), number, number1) await asyncio.sleep(1) except asyncio.TimeoutError: pass try: cog = self.bot.get_cog("Autorole") if cog: if (await self._get_response(ctx, question4, predicate)).lower() == "yes": await ctx.invoke(ctx.bot.get_command("autorole toggle")) await asyncio.sleep(1) rolemessage = await self._get_response( ctx, "What role would you like to be added to new users?", predicate2) role = await commands.RoleConverter().convert( ctx, rolemessage) await ctx.invoke(ctx.bot.get_command("autorole add"), role=role) await asyncio.sleep(1) except asyncio.TimeoutError: pass try: cog = self.bot.get_cog("BanCheck") if cog: if (await self._get_response(ctx, question5, predicate)).lower() == "yes": channelmessage = await self._get_response( ctx, "What channel would you like to be used as log?", predicate2) channel = await (TextChannelConverter()).convert( ctx, channelmessage) await ctx.invoke( ctx.bot.get_command("bancheckset enablechannel"), channel) await asyncio.sleep(1) except asyncio.TimeoutError: pass try: cog = self.bot.get_cog("Bank") if cog: if (await self._get_response(ctx, question6, predicate)).lower() == "yes": name = await self._get_response( ctx, "What would you like the bank to be called?", predicate2) await ctx.invoke(ctx.bot.get_command("bankset bankname"), name=name) await asyncio.sleep(1) name1 = await self._get_response( ctx, "What would you like the credits to be called?", predicate2) await ctx.invoke( ctx.bot.get_command("bankset creditsname"), name=name1) await asyncio.sleep(1) except asyncio.TimeoutError: pass try: cog = self.bot.get_cog("Grenzpolizei") if cog: if (await self._get_response(ctx, question7, predicate)).lower() == "yes": await ctx.invoke(ctx.bot.get_command("gp autosetup")) await asyncio.sleep(1) except asyncio.TimeoutError: pass try: cog = self.bot.get_cog("Casino") if cog: if (await self._get_response(ctx, question8, predicate)).lower() == "yes": name = await self._get_response( ctx, "What would you like the casino to be called?", predicate2) await ctx.invoke(ctx.bot.get_command("casinoset name"), name=name) await asyncio.sleep(1) except asyncio.TimeoutError: pass try: cog = self.bot.get_cog("CleverBot") if cog: if (await self._get_response(ctx, question9, predicate)).lower() == "yes": await ctx.invoke(ctx.bot.get_command("cleverbotset toggle") ) await asyncio.sleep(1) except asyncio.TimeoutError: pass try: cog = self.bot.get_cog("Dungeon") if cog: if (await self._get_response(ctx, question10, predicate)).lower() == "yes": await ctx.invoke(ctx.bot.get_command("dungeon toggle")) await asyncio.sleep(0.5) await ctx.invoke(ctx.bot.get_command("dungeon autoban")) await asyncio.sleep(1) days = await self._get_response( ctx, "How many days old must an account be before I automatically ban them?", predicate1, ) await ctx.invoke(ctx.bot.get_command("dungeon joindays"), days=days) await asyncio.sleep(1) ans = await self._get_response( ctx, "Would you like users with default profile pics to be banned?", predicate, ) if ans.lower() == "yes": await ctx.invoke( ctx.bot.get_command("dungeon profiletoggle`")) await asyncio.sleep(1) except asyncio.TimeoutError: pass try: cog = self.bot.get_cog("Economy") if cog: if (await self._get_response(ctx, question11, predicate)).lower() == "yes": amount = await self._get_response( ctx, "How many credits should be given for using the payday command?", predicate1, ) await ctx.invoke( ctx.bot.get_command("economyset paydayamount"), creds=int(amount)) await asyncio.sleep(1) ans = await self._get_response( ctx, "Would you like to change the cooldown time for the payday command?", predicate, ) if ans.lower() == "yes": await asyncio.sleep(1) time = int(await self._get_response( ctx, "How many seconds would you like the cooldown to be?", predicate1, )) await ctx.invoke( ctx.bot.get_command("economyset paydaytime"), seconds=time) await asyncio.sleep(1) register = await self._get_response( ctx, "Would you like to change the amount of credits new " "accounts start with?", predicate, ) if register.lower() == "yes": await asyncio.sleep(1) amount1 = await self._get_response( ctx, "How many credits would you like new accounts to start with?", predicate1, ) await ctx.invoke(ctx.bot.get_command( "economyset registeramount"), creds=int(amount1)) await asyncio.sleep(1) except asyncio.TimeoutError: pass try: cog = self.bot.get_cog("Filter") if cog: if (await self._get_response(ctx, question12, predicate)).lower() == "yes": filt = await self._get_response( ctx, "What words would you like to be added to the filter? " "(separate each word with a space, if it is a sentence " "or phrase put it inside " "quotes" ")", predicate2, ) await ctx.invoke(ctx.bot.get_command("filter add"), *filt) await asyncio.sleep(1) except asyncio.TimeoutError: pass try: cog = self.bot.get_cog("InfoChannel") if cog: if (await self._get_response(ctx, question13, predicate)).lower() == "yes": await ctx.invoke(ctx.bot.get_command("infochannel")) await asyncio.sleep(1) except asyncio.TimeoutError: pass try: cog = self.bot.get_cog("Leaver") if cog: if (await self._get_response(ctx, question14, predicate)).lower() == "yes": await ctx.send( "**Use `]leaverset channel` in the channel you wish to " "recieve the messages**") await asyncio.sleep(1) except asyncio.TimeoutError: pass try: cog = self.bot.get_cog("Mod") if cog: if (await self._get_response(ctx, question16, predicate)).lower() == "yes": repeats = await self._get_response( ctx, "Would you like to automatically delete repeated messages?", predicate) if repeats.lower() == "yes": await asyncio.sleep(1) await ctx.invoke( ctx.bot.get_command("modset deleterepeats")) await asyncio.sleep(1) delay = await self._get_response( ctx, "Would you like to automatically delete command messages?", predicate, ) if delay.lower() == "yes": await asyncio.sleep(1) delay1 = await self._get_response( ctx, "How many seconds should I wait before deleting them?", predicate1, ) await ctx.invoke( ctx.bot.get_command("modset deletedelay"), time=delay1) await asyncio.sleep(1) except asyncio.TimeoutError: pass try: cog = self.bot.get_cog("ModLog") if cog: if (await self._get_response(ctx, question17, predicate)).lower() == "yes": await asyncio.sleep(1) channelmessage = await self._get_response( ctx, "What channel would you like the logs to go to?", predicate2) channel = await (TextChannelConverter()).convert( ctx, channelmessage) await ctx.invoke(ctx.bot.get_command("modlogset modlog"), channel=channel) await asyncio.sleep(1) except asyncio.TimeoutError: pass try: cog = self.bot.get_cog("Reports") if cog: if (await self._get_response(ctx, question18, predicate)).lower() == "yes": await asyncio.sleep(1) channelmessage = await self._get_response( ctx, "What channel would you like the reports to go to?", predicate2) channel = await (TextChannelConverter()).convert( ctx, channelmessage) await ctx.invoke(ctx.bot.get_command("reportset toggle")) await asyncio.sleep(0.5) await ctx.invoke(ctx.bot.get_command("reportset output"), channel=channel) await asyncio.sleep(1) except asyncio.TimeoutError: pass try: cog = self.bot.get_cog("Starboard") if cog: if (await self._get_response(ctx, question19, predicate)).lower() == "yes": await asyncio.sleep(1) name = await self._get_response( ctx, "What would you like the starboard to be called?", predicate2) await asyncio.sleep(0.5) channelmessage = await self._get_response( ctx, "What channel would you like the starboard to be in?", predicate2) channel = await (TextChannelConverter()).convert( ctx, channelmessage) await ctx.invoke(ctx.bot.get_command("starboard create"), name=name, channel=channel) await asyncio.sleep(1) except asyncio.TimeoutError: pass try: cog = self.bot.get_cog("Tickets") if cog: if (await self._get_response(ctx, question20, predicate)).lower() == "yes": await ctx.invoke(ctx.bot.get_command("ticket set setup")) await asyncio.sleep(1) except asyncio.TimeoutError: pass try: cog = self.bot.get_cog("Welcome") if cog: if (await self._get_response(ctx, question21, predicate)).lower() == "yes": await ctx.invoke( ctx.bot.get_command("welcomeset leave toggle")) await ctx.invoke( ctx.bot.get_command("welcomeset ban toggle")) await ctx.invoke( ctx.bot.get_command("welcomeset unban toggle")) await ctx.invoke(ctx.bot.get_command("welcomeset toggle")) await ctx.send("Now do [p]welcomeset join msg add") await ctx.send( "**After you have added the new message do the following command and " "then type the number of the old default message**\n" "`]welcomeset join msg del`") await asyncio.sleep(1) except asyncio.TimeoutError: pass try: cog = self.bot.get_cog("Core") if cog: if (await self._get_response(ctx, question22, predicate)).lower() == "yes": await asyncio.sleep(1) rolemessage = await self._get_response( ctx, "What role would you like mods to have?", predicate2) role = await commands.RoleConverter().convert( ctx, rolemessage) await ctx.invoke(ctx.bot.get_command("set addmodrole"), role=role) await asyncio.sleep(1) role1 = await self._get_response( ctx, "What role would you like admins to have?", predicate2) role2 = await commands.RoleConverter().convert(ctx, role1) await ctx.invoke(ctx.bot.get_command("set addadminrole"), role=role2) await asyncio.sleep(1) except asyncio.TimeoutError: pass try: cog = self.bot.get_cog("ReactRoles") if cog: if (await self._get_response(ctx, question23, predicate)).lower() == "yes": await ctx.send( "Use `[p]reactroles add ` with the message ID, channel, emoji and role.\n" "**Hint: To get the message ID, turn on developer mode in Discord's " "appearance settings and then right click the message and click copy ID **" ) except asyncio.TimeoutError: return