@Kognise/

useless bot

Python

No description

fork
loading
Files
  • main.py
  • poetry.lock
  • pyproject.toml
  • requirements.txt
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
import discord
from discord.ext import commands
from flask import Flask
from threading import Thread
import os

client = commands.Bot(command_prefix="!")
owner = 552620070266994688
treasurer = 442531250880905216

@client.command()
async def update(ctx, name, number):
  if (ctx.author.id == owner) or (ctx.author.id == treasurer):
    god = client.get_user(treasurer)
    await god.send(f"Set the balance of {name} to **{number} AP**")
    await ctx.send("Done!")
  else:
    await ctx.send("Sorry, you can't do that!")

@client.command()
async def add(ctx, name, number):
  if (ctx.author.id == owner) or (ctx.author.id == treasurer):
    god = client.get_user(treasurer)
    await god.send(f"Give {name} **{number} AP**")
    await ctx.send("Done!")
  else:
    await ctx.send("Sorry, you can't do that!")
@client.command()

async def subtract(ctx, name, number):
  if (ctx.author.id == owner) or (ctx.author.id == treasurer):
    god = client.get_user(treasurer)
    await god.send(f"Take **{number} AP** away from {name}")
    await ctx.send("Done!")
  else:
    await ctx.send("Sorry, you can't do that!")

app = Flask('')

@app.route('/')
def main():
  return "The bot is alive!"

def run():
  app.run(host="0.0.0.0", port=8080)

def keep_alive():
  server = Thread(target=run)
  server.start()
  print("Server ready!")

@client.event
async def on_ready():
  print("Bot ready!")
  keep_alive()

client.run(os.environ["TOKEN"])