def _getmoji(self, msg):
args = msg.content.split()
if len(args) > 1:
if len(args[1]) == 1:
try:
await msg.add_reaction(args[1])
except HTTPException:
raise CommandSyntaxError(f"Non-emoji character set as spam reaction on server.")
else:
self.plugin_config[str(msg.guild.id)]["spam_reaction"] = args[1]
await respond(msg, f"**AFFIRMATIVE. ANALYSIS: New spam reaction emoji: {args[1]}.**")
await msg.remove_reaction(args[1], msg.guild.me)
elif re.fullmatch("<:\w{1,32}:\d{1,20}>", args[1]):
t_emoji = re.search("\d{1,20}", args[1])[0]
if self.client.get_emoji(int(t_emoji)):
self.plugin_config[str(msg.guild.id)]["spam_reaction"] = t_emoji.rjust(18, "0")
await respond(msg, f"**AFFIRMATIVE. ANALYSIS: New spam reaction emoji: {args[1]}.**")
else:
raise CommandSyntaxError("Expected a single emoji as argument.")
else:
self.plugin_config[str(msg.guild.id)]["spam_reaction"] = False
await respond(msg, f"**AFFIRMATIVE. Spam reaction disabled.**")
评论列表
文章目录