-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.py
60 lines (53 loc) · 1.53 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
import os
import discord
from dotenv import load_dotenv
from discord.ext import commands
from rich.console import Console
import firebase_admin
from firebase_admin import credentials
from cogs.welcomes import Roles, GetRoles
from cogs.giveaways import MyView
# from cogs.shops import NitroView, GiftCardView, ShipView, PaginatorView
from cogs.casinos import RandomView, DiceView
console = Console()
load_dotenv()
TOKEN = os.getenv("TOKEN")
cogs_list = [
'welcomes',
'voices',
'coins',
'giveaways',
# 'shops',
'casinos',
'utils',
'announces',
# 'youtube',
]
intents = discord.Intents.all()
bot = commands.Bot(command_prefix='!', intents=intents)
credential = os.getenv("FIREBASE_CREDENTIALS")
DB_URL = os.getenv("DB_URL")
UID = os.getenv("UID")
cred = credentials.Certificate(credential)
firebase_admin.initialize_app(cred, {
'databaseURL': DB_URL,
'databaseAuthVariableOverride' : {
'uid' : UID
}
})
@bot.event
async def on_ready():
console.log(f'{bot.user.name} has connected to Discord!')
bot.add_view(Roles(bot))
bot.add_view(GetRoles())
bot.add_view(MyView(bot))
# bot.add_view(PaginatorView())
bot.add_view(RandomView(bot))
bot.add_view(DiceView(bot))
await bot.change_presence(activity=discord.Game(name="Star Citizen"))
for guild in bot.guilds:
# PRINT THE SERVER'S ID AND NAME.
console.log(f"- {guild.id} | {guild.name}")
for cog in cogs_list:
bot.load_extension(f'cogs.{cog}')
bot.run(TOKEN)