-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample.py
More file actions
32 lines (20 loc) · 872 Bytes
/
example.py
File metadata and controls
32 lines (20 loc) · 872 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
import discord # USING py-cord (https://pypi.org/project/py-cord/)
from dbleupy import dbleu_postservercount, dbleu_getbotvotes, dbleu_getbotdata
from discord.ext import commands, tasks
intents = discord.Intents.all()
bot = commands.Bot(command_prefix=commands.when_mentioned_or("-"), intents=intents)
dbleuKEY = "" # Get it from https://dev.discord-botlist.eu
@bot.event
async def on_ready():
# Start auto_post()
auto_post.start()
print(f"Online as {bot.user.name}")
r = dbleu_getbotvotes(dbleuKEY, log_disable=False)
print(r.content)
r = dbleu_getbotdata(dbleuKEY, log_disable=False)
print(r.content)
@tasks.loop(minutes=5)
async def auto_post():
dbleu_postservercount(dbleuKEY, bot, log_disable=False)
# IMPORTANT: The second parameter must be the discord.ext.commands.bot.Bot object
bot.run("DISCORD-BOT-TOKEN")