Skip to content
Permalink
Browse files
Update discordbot.py
  • Loading branch information
mchughs3 committed Nov 24, 2022
1 parent 680952a commit 027c8a3f805fc9843b366cb095926a671154c659
Showing 1 changed file with 70 additions and 4 deletions.
@@ -3,10 +3,12 @@ from discord.ext import commands ## for discord
import json # for json files
import requests ## for API
import random
import secrets ## for API keys
import secretkeys ## for API keys
import botfunctions as idk ## for botfunctions.py functions
import asyncio

import matplotlib as plt
import os
import numpy as np
greetings = ['hello','hi','whats up','sup','yo','hey']

## setting intents for discord bot#
@@ -115,6 +117,70 @@ async def on_message(message):
async with channel.typing():
await asyncio.sleep(1)
await channel.send(embed = history)


bot.run(secrets.discord_bot_key)


#sean
if 'puuid' in message.content:
channel = message.channel
async with channel.typing():
await asyncio.sleep(1)
await channel.send('Whats your summoner name?')

def check(m):
return message.content

msg = await bot.wait_for('message', check=check)

async with channel.typing():
await asyncio.sleep(1)
await channel.send('Whats your region?')

def check(m):
return message.content

msg2 = await bot.wait_for('message', check=check)

await channel.send(idk.get_player_puuid(msg.content, msg2.content))

if 'game' in message.content:
channel = message.channel
async with channel.typing():
await asyncio.sleep(1)
await channel.send('which one of your recent games would you like the stats for?')

def check(m):
return message.content

game = await bot.wait_for('message', check=check)
gamenum = int(game.content)
async with channel.typing():
await asyncio.sleep(1)
await channel.send('Whats your name?')

def check(m):
return message.content

name = await bot.wait_for('message', check=check)

await channel.send(idk.display_match_stats(gamenum))

if 'kills' in message.content:
idk.displayKills()
channel = message.channel
await channel.send(file =discord.File("kills.png"))

if 'deaths' in message.content:
idk.displayDeaths()
channel = message.channel
await channel.send(file =discord.File("deaths.png"))

if 'assists' in message.content:
idk.displayAssists()
channel = message.channel
await channel.send(file =discord.File("assists.png"))




bot.run(secretkeys.discord_bot_key)

0 comments on commit 027c8a3

Please sign in to comment.