├── README.md └── main.py /README.md: -------------------------------------------------------------------------------- 1 | # Discord-Vanity-Notifer 2 | If Someone Added Your Vanity In Status Gives Them Role And Sends Their Name To Logging Channel 3 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | import discord 2 | from discord.ext import commands 3 | import os 4 | 5 | os.system("clear||cls") 6 | 7 | care = commands.Bot(command_prefix="69", intents=discord.Intents.all()) 8 | 9 | roleidtogive = 938306304294924328 #your role id 10 | vanity = "/testin"#your vanity 11 | tk = ""# token 12 | logging_channel_id = 938056704829038684 # channel id 13 | 14 | @care.event 15 | async def on_ready(): 16 | print("Ready!") 17 | 18 | 19 | 20 | @care.event 21 | async def on_member_update(before, after): 22 | if str(before.raw_status) == "offline": 23 | return 24 | else: 25 | try: 26 | bst = after.activities[0].name 27 | ast = before.activities[0].name 28 | if vanity in bst: 29 | if not vanity in ast: 30 | channel = care.get_channel(logging_channel_id) 31 | role = after.guild.get_role(roleidtogive) 32 | await after.add_roles(role, reason="Added Vanity In Status") 33 | await channel.send(f"Added") 34 | elif vanity in ast: 35 | if not vanity in bst: 36 | channel = care.get_channel(logging_channel_id) 37 | role = after.guild.get_role(roleidtogive) 38 | if role in after.roles: 39 | await after.remove_roles(role, reason="Removed Vanity From Status") 40 | await channel.send(f"Removed") 41 | except: 42 | pass 43 | 44 | 45 | 46 | care.run(tk) 47 | --------------------------------------------------------------------------------