forked from Skelmis/Discord-Bot-Base
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.py
54 lines (39 loc) · 1.06 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
import logging
import os
import discord
from bot_base import BotBase, context
from bot_base.paginators.disnake_paginator import discordPaginator, PaginationView
from dotenv import load_dotenv
load_dotenv()
logging.basicConfig(level=logging.INFO)
bot = BotBase(
command_prefix="t.",
mongo_url=os.environ["MONGO_URL"],
mongo_database_name="my_bot",
load_builtin_commands=True,
intents = discord.Intents.all()
)
@bot.event
async def on_ready():
print("I'm up.")
@bot.command()
async def echo(ctx):
await ctx.message.delete()
text = await ctx.get_input("What should I say?", timeout=5)
if not text:
return await ctx.send("You said nothing!")
await ctx.send(text)
await ctx.send(bot.gen_uuid())
@bot.command()
async def ping(ctx):
d = (("Water#2222", 554), ("Ace#2222", 333))
x = []
for i in d:
fmt = (
f"**Name:** {i[0]}\n"
f"**Warn ID:** {i[1]}"
)
x.append(fmt)
pag = discordPaginator(1, x)
await pag.start(context = ctx)
bot.run(os.environ["TOKEN"])