-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot.py
84 lines (71 loc) · 2.9 KB
/
bot.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import discord, colorama
from colorama import Fore
from discord.ext import commands
from art import text2art
from data import *
from birthday import *
intents = discord.Intents.all()
client = discord.Client(intents=intents)
bot = commands.Bot(command_prefix="")
@bot.event
async def on_ready():
print(text2art("Bot is ready"))
@bot.event
async def on_message(message):
send(message)
await bot.process_commands(message)
@bot.event
async def on_message_delete(message):
delete(message)
@bot.event
async def on_message_edit(before, after):
edit(before, after)
@bot.command()
async def clear(message, num):
author_all_roles = [i.name for i in message.author.roles]
if ("Administrator" in author_all_roles):
await message.channel.purge(limit=int(num)+1)
else:
await message.reply(f"Hey {message.author} only admins could use this command")
@bot.command()
async def birthday(message, status, date=None):
if (date != None):
if (status == "add"):
result = birthday_adder(message, date)
if (result == False):
await message.reply("You have already added your Birthday")
else:
await message.reply('Your birthday has been added succesfuly')
elif (status == "update"):
result = birthday_updater(message, date)
if (result == False):
await message.reply("You haven't added your birthday yet")
else:
await message.reply('Your birthday has been updated succesfuly')
else:
await message.reply("Command is not acceptable")
else:
if (status == "activate"):
author_all_roles = [i.name for i in message.author.roles]
if ("Administrator" in author_all_roles):
result = birthday_teller(status)
await message.reply("Birthday has been activated succesfuly")
[await message.channel.send(f"The day has been arrived!\nIts' {i}'s birthday :partying_face::tada:") for i in result]
else:
await message.reply(f"Hey {message.author} only admins could use this command")
elif (status == "deactivate"):
author_all_roles = [i.name for i in messagulte.author.roles]
if ("Administrator" in author_all_roles):
birthday_teller(status)
await message.reply("Birthday has been deactivated succesfuly")
else:
await message.reply(f"Hey {message.author} only admins could use this command")
elif (status == "delete"):
result = birthday_deleter(message)
if (result == False):
await message.reply("You haven't added your birthday yet")
else:
await message.reply("Your birthday has been deleted succesfuly")
else:
await message.reply("Command is not acceptable")
bot.run("BOT_TOKEN")