-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBot.py
More file actions
60 lines (46 loc) · 1.82 KB
/
Copy pathBot.py
File metadata and controls
60 lines (46 loc) · 1.82 KB
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
import discord
from CalC import add, subtract, multiply, division, remainder
from twilio_message import *
from Onliner import keep_alive
intents = discord.Intents.default()
intents.members = True
client = discord.Client(intents=intents)
token_file = open("discord_token.txt", "r")
token = token_file.read()
@client.event
async def on_ready():
print( str(client.user) + " is Ready!!")
@client.event
async def on_message(message):
if client.user == message.author:
pass
elif message.content.startswith("add"):
addResult = add(message.content)
await message.channel.send(addResult.getResult())
elif message.content.startswith("sub"):
subResult = subtract(message.content)
await message.channel.send(subResult.get_result())
elif message.content.startswith("multiply"):
mul_result = multiply(message.content)
await message.channel.send(mul_result.get_result())
elif message.content.startswith("div"):
divResult = division(message.content)
await message.channel.send(divResult.get_result())
elif message.content.startswith("rem"):
remResult = remainder(message.content)
await message.channel.send(remResult.get_result())
elif message.content.startswith("sms"):
sms = twilio_message(message.content)
await message.channel.send(sms.send_sms())
@client.event
async def on_member_join(member):
for channel in member.guild.channels:
if str(channel) == "member-log":
await channel.send(f"{member.mention} Joined, Have a good time here!")
@client.event
async def on_member_remove(member):
for channel in member.guild.channels:
if str(channel) == "member-log":
await channel.send(f'{member.mention} left, You won\'t be missed(Probably xD)!')
keep_alive()
client.run(token)