-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
36 lines (24 loc) · 749 Bytes
/
main.py
File metadata and controls
36 lines (24 loc) · 749 Bytes
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
import os
import discord, json
from discord.ext import commands
from truthdare import TruthDareCog
if os.path.exists('config.json'):
with open('config.json', 'r') as f:
config = json.loads(f.read())
else:
config = {}
if os.environ.get('BOT_TOKEN') is not None:
config['botToken'] = os.environ['BOT_TOKEN']
if os.environ.get("BOT_PREFIX") is not None:
config['prefix'] = os.environ['BOT_PREFIX']
intents = discord.Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix=config['prefix'], intents=intents)
@bot.event
async def on_ready():
await bot.add_cog(TruthDareCog(bot))
await bot.tree.sync()
def main():
bot.run(config['botToken'])
if __name__ == '__main__':
main()