-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
61 lines (43 loc) · 1.68 KB
/
main.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
import os
import discord
from discord.ext import commands
from dotenv import load_dotenv
from requests.exceptions import HTTPError
from riotwatcher import ApiError, LolWatcher
import helpers.riot_helper as riot_helper
from functions.builds import builds_command
from functions.runes import runes_command
from functions.skillbuilds import skillbuilds_command
from functions.sum import sum_command
from functions.test import test_command
load_dotenv()
TOKEN = os.getenv("DISCORD_TOKEN")
# GUILD = os.getenv("DISCORD_GUILD")
RIOT = os.getenv("RIOT_TOKEN")
lol_watcher = LolWatcher(RIOT)
bot = commands.Bot(command_prefix=">>")
@bot.command()
async def test(ctx, ext=None, sum_name=None):
await ctx.send(test_command(ctx, ext, lol_watcher, sum_name))
@bot.command()
async def sum(ctx, sum_name=None, ext=None):
try:
await ctx.send(sum_command(lol_watcher, ctx, sum_name, ext))
except HTTPError as e:
await ctx.send(riot_helper.error_handling(e))
@bot.command()
async def runes(ctx, champ_name=None, role=None, num=None):
await ctx.send(runes_command(bot, champ_name, role, num))
@bot.command()
async def builds(ctx, champ_name=None, role=None):
await ctx.send(builds_command(champ_name, role))
@bot.command()
async def fullbuild(ctx, champ_name=None, role=None, num=None):
await ctx.send(runes_command(bot, champ_name, role, num)) # runes
await ctx.send(skillbuilds_command(champ_name, role)) # skillbuilds
await ctx.send(builds_command(champ_name, role)) # builds
@bot.command()
async def skillbuild(ctx, champ_name=None, role=None, num=None):
await ctx.send(skillbuilds_command(champ_name, role)) # skillbuilds
print("running!")
bot.run(TOKEN)