-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbot.py
More file actions
75 lines (62 loc) · 1.78 KB
/
Copy pathbot.py
File metadata and controls
75 lines (62 loc) · 1.78 KB
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
70
71
72
73
74
75
import os
import discord
from discord import message
import dotenv
from discord.ext import commands
from discord.ext import tasks
from commands.request import *
from commands.file import *
from commands.graph import *
from commands.help import *
dotenv.load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
bot = discord.Client()
bot = commands.Bot(command_prefix=';')
bot.remove_command("help")
Request=Request()
File=File()
Graph=Graph()
Help=Help()
@ bot.event
async def on_ready():
print('Bot online')
await bot.change_presence(activity=discord.Game(name="Type ;help"))
@ bot.command()
async def stats(ctx, *arg):
if len(arg) == 0:
arg = await File.getUser(ctx.message.author.id)
embed=await Request.getStats(arg)
await ctx.send(embed = embed)
@ bot.command()
async def map(ctx):
BattleRoyale,Arena = await Request.getMap()
await ctx.send(embed = BattleRoyale)
if (Arena != None):
await ctx.send(embed = Arena)
@ bot.command()
async def link(ctx, *arg):
embed=await File.saveUser(arg,ctx.message.author.id,ctx.message.author.name)
await ctx.send(embed = embed)
@ bot.command()
async def unlink(ctx):
embed=await File.delUser(ctx.message.author.id)
await ctx.send(embed = embed)
@ bot.command()
async def graph(ctx, *arg):
embed,image = await Graph.legendGraph(arg)
if image == True:
embed.set_image(url='attachment://img.png')
img = discord.File("./img/img.png", filename="img.png")
await ctx.send(file = img, embed = embed)
else:
await ctx.send(embed = embed)
@ bot.command()
async def help(ctx):
embed = await Help.displayHelp()
await ctx.send(embed = embed)
@tasks.loop(hours=24)
async def refresh():
print("Stats Update")
await Request.updateStats()
refresh.start()
bot.run(TOKEN)