-
Notifications
You must be signed in to change notification settings - Fork 0
/
foreverwerewolf.py
50 lines (40 loc) · 1.72 KB
/
foreverwerewolf.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
import datetime
import logging
import os
import discord
from discord.ext import commands
intents = discord.Intents(guilds=True, members=True, messages=True)
date = f'{datetime.datetime.now().year}-{datetime.datetime.now().month}-{datetime.datetime.now().day}'
logging.basicConfig(
filename=f'logs/{date}.log',
format='%(asctime)s - %(levelname)s - %(message)s',
level=logging.INFO
)
bot = commands.Bot(command_prefix=['wolf.', 'Wolf.'],
description='The wolfiest bot for discord-based Werewolf.\n'
'If you have questions, feel free to contact Cal.\n\n'
'* * * * * * * *\n'
'It\'s very exciting how the usage of this bot has grown, but that brings with it '
'added cost as it expands to more servers. If you like the bot, please consider '
'buying me a coffee to keep this one online: https://ko-fi.com/manticorum\n'
'* * * * * * * *\n',
case_insensitive=True,
intents=intents,
owner_id=258104532423147520)
@bot.event
async def on_ready():
logging.info('Logged in as:')
logging.info(bot.user.name)
logging.info(bot.user.id)
for filename in os.listdir('./cogs'):
if filename.endswith('.py'):
c = filename[:-3]
try:
bot.load_extension(f'cogs.{c}')
logging.info(f'Loaded cog: {c}')
except Exception as e:
logging.info(f'******\nFailed to load cog: {c}')
logging.info(f'{type(e).__name__} - {e}')
# Main
if __name__ == '__main__':
bot.run("TOKEN_HERE")