-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugin-t-t_virus.py
29 lines (22 loc) · 1.16 KB
/
plugin-t-t_virus.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from xander_plugin import *
def onload():
help_menu_edit("T-T virus plugin", "A plugin that spreads the T-T virus.")
log("T-T virus plugin loaded")
async def onmessage(message):
if ("t-t" in message.content.lower()) and (not "t-t virus" in [y.name.lower() for y in message.author.roles]):
await message.author.add_roles(discord.utils.get(message.author.guild.roles, name="T-T virus"))
await message.channel.send("The power of the T-T virus has spread and you are now infected!")
elif ("-t-" in message.content.lower()) and ("t-t virus" in [y.name.lower() for y in message.author.roles]):
await message.author.remove_roles(discord.utils.get(message.author.guild.roles, name="T-T virus"))
if message.content == "!virus2":
role = discord.utils.get(message.author.guild.roles, name="T-T virus")
infected = 0
members = [m for m in message.guild.members]
for member in members:
if role in member.roles:
infected += 1
await message.channel.send(f"{infected} people are infected in this server.")
return False
return True
def onexit():
log("T-T virus exit run")