-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphilipsBot.py
46 lines (36 loc) · 1.18 KB
/
philipsBot.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
from dotenv import load_dotenv
load_dotenv()
import os
import discord
from discord.ext import commands
from misc import jsonHandler as jso
client = commands.Bot(command_prefix="-", case_insensitive=True)
@client.event
async def on_ready():
print(f"[Client] {client.user} connected to discord!")
@client.command(name="shutdown")
async def _shutdown(ctx):
"""
Shut downs bot
"""
id = 686846374737739797
if str(ctx.author.id) != str(id):
await ctx.send("You are not the bot owner!")
else:
print(f"[Client] {client.user} logged out!")
await ctx.send(':wave: Bye Bye!')
await ctx.bot.logout()
@client.command(name="togglechange", aliases=["tcg"])
async def _changetoggle(ctx, type: bool):
"""
Allow/Disallow Light Controller
"""
id = 686846374737739797
if str(ctx.author.id) != str(id):
await ctx.send("You are not the bot owner!")
else:
data = { "allowDiscordChange": type }
jso.writeJson("controller.json", data)
client.load_extension('cogs.LightController')
client.load_extension('cogs.Colours')
client.run(os.getenv("discordToken"))