-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.py
69 lines (43 loc) · 1.69 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
# -*- coding: utf8 -*-
import nextcord
import requests
from datetime import datetime
from config import *
import os
import sqlite3
from nextcord.ext import tasks
from nextcord.ext import commands
intents = nextcord.Intents.all()
activity = None
status = None
if settings['status'] == "watching":
activity = nextcord.Activity(type=nextcord.ActivityType.watching, name=settings['text'])
elif settings['status'] == "streaming":
activity = nextcord.Streaming(name=settings['text'])
elif settings['status'] == "game":
activity = nextcord.Game(name=settings['text'])
elif settings['status'] == "listening":
activity = nextcord.Activity(type=nextcord.ActivityType.listening, name=settings['text'])
elif settings['status'] == "none":
activity = None
else:
activity = None
print(__name__ + ' : Параметры конфигурации заданы неверно: ' + settings['status'])
if settings['activity'] == "offline":
status = nextcord.Status.offline
elif settings['activity'] == "idle":
status = nextcord.Status.idle
elif settings['activity'] == "dnd":
status = nextcord.Status.dnd
elif settings['activity'] == "none":
status = None
else:
status = nextcord.Status.online
print(__name__ + ' : Параметры конфигурации заданы неверно: ' + settings['activity'])
bot = commands.Bot(command_prefix=settings['prefix'], intents=intents, activity= activity, status=status)
banner_db = sqlite3.connect('database/banner.db', timeout=10)
banner = banner_db.cursor()
for filename in os.listdir(".\cogs"):
if filename.endswith(".py"):
bot.load_extension(f"cogs.{filename[:-3]}")
bot.run(settings['token'])