Skip to content

Instantly share code, notes, and snippets.

@timelessnesses
Created May 21, 2021 07:45
Show Gist options
  • Save timelessnesses/97f3799a57f4f034f86e93e3a0909ffb to your computer and use it in GitHub Desktop.
Save timelessnesses/97f3799a57f4f034f86e93e3a0909ffb to your computer and use it in GitHub Desktop.
bot itself
from flask import Flask
from threading import Thread
app = Flask(__name__)
@app.route('/')
def main():
return {"hello" : "everything is ok"}
def run():
app.run(host="0.0.0.0",port=8080)
def a():
server = Thread(target=run)
server.start()
import discord
from discord.ext import commands,tasks
from SimpleEconomy import Seco
import random
import asyncio
bot = commands.Bot(command_prefix="d")
@bot.event
async def on_command_error(ctx,error):
if isinstance(error,commands.errors.CommandNotFound):
await ctx.send("T̵̥̟̤͔̜̀̓͆H̸̟̪̪̤͒̎͂A̶̝͇̫̎͂͝T̸̝̗̖̀̾́̋ ̷̘̪̜̃͒̍̽Ĉ̸̝̙̱̿̓̚O̶̡̱̣͕͜͠M̴̢̘̜͎̍̒͠M̸̰͙̥͕͗́͗̊ͅÀ̶̰̖͔͉̼́́̕͝Ń̵̢̳̖̜̟́̉͑D̵̺͙̄͐̀̐͘ ̸̨̳̯̖̂͊I̶̡̟͖̫͑ͅŞ̵̱͈̠͇̐Ņ̵̰͚͒̽'̴͎̘̇̄̃̌̑Ț̷̣̦̅̀͋̒̀ ̸̲̫͇̜͐͆E̵̼̟͝X̴͚̺͇̙̀͋̿̉̓Ȉ̸͚̲̺̖̌̋S̷̙͖͕̬̭̽́̇̌̑T̸̙̤̖͍͎̏͌̔̿̅ ̷͎̟̲̑̊>̷̼͉̪͇̋͆̓:̵̻̖̘̯̭̎D̴̞̺̗̫̎̓")
else:
await ctx.send(discord.Embed(title=error))
if isinstance(asyncio.exceptions.TimeoutError,error):
await ctx.send("Time out!")
@bot.event
async def on_ready():
while True:
await change()
import os
seco=Seco(bot,"kYEUqXXGyTMICVtyY0MG1Ldr3QAcgElsGQJ9hdEYz4Kh16jVZh970wUuagWFtKds","hentai",logs=True)
async def change():
s = ["GoodJohn Best friend forever!","Made by __name__#1001","UwU","BRUH","EEEEEEE","MONEY GO BRRRRRR"]
text=random.choice(s)
await bot.change_presence(activity=discord.Game(name=text),status=discord.Status.dnd)
await asyncio.sleep(3)
@bot.command()
@commands.cooldown(1,5,commands.BucketType.user)
async def beg(ctx,secret=None):
if secret is not None:
await seco.add_balance(ctx.author.id,999999999999999999999)
beg_list=["ELon Musk donated you ","You got lucky and got ","You win prize at untrustworthy money center and you get","Stonk give his benifit to you ","Pokimane donated you"]
amount=random.randint(0,1000000)
text=random.choice(beg_list) + str(amount) +"$"
await seco.add_balance(ctx.author.id,amount)
e=discord.Embed(
title="Begging",
description=text
)
await ctx.send(embed=e)
@bot.command()
async def bal(ctx,member: discord.User = None):
if member is None:
balance=await seco.get_balance(ctx.author.id)
e=discord.Embed(title="Bank",description=f"Your Bank balance is: {balance}")
else:
balance = await seco.get_balance(member.id)
e=discord.Embed(title="Bank",description=f"Your Bank balance is: {balance}")
await ctx.send(embed=e)
@bot.command()
async def leaderboard(ctx):
leaderboard=await seco.leaderboard(limit=50)
print(leaderboard)
text = ""
for person in leaderboard:
user = await bot.fetch_user(int(person["userid"]))
text+=str(leaderboard.index(person)+1)+") "+user.display_name+" - "+str(person["balance"])+"\n"
e = discord.Embed(title="Leaderboard",description=text)
await ctx.send(embed=e)
@bot.command()
async def send(ctx,member:discord.User,num: int):
await ctx.send("Taking your money in bank with out you knowing I take it :D")
await seco.transfer_balance(ctx.author.id,member.id,num)
await ctx.send(f"Sent to {member.name}!")
@bot.command()
@commands.cooldown(1,10,commands.BucketType.user)
async def steal(ctx,member:discord.User,worth=500):
if await seco.get_balance(member.id) <= 2000:
await ctx.send("YOU HAVE SO MUCH DARK MIND! WHY YOU ARE GONNA STEAL SOME POOR PEOPLE?")
return
await ctx.send("Woah woah there buddy! Are you gonna steal someone? Okay then.")
await asyncio.sleep(3)
await ctx.send("Making plan")
b = random.randint(0,1)
if b is 0:
await ctx.send(f"Your robbing plan was sucessfully! Here\'s money that you were steal from {member.display_name} {worth}")
await seco.add_balance(ctx.author.id,worth)
await seco.remove_balance(member.id,worth)
if b is 1:
rand = random.randint(0,await seco.get_balance(ctx.author.name))
await seco.remove_balance(ctx.author.id,rand)
await seco.add_balance(member.id,worth+rand)
await ctx.send(f"Oopsie da woopsie your money is taken due fine and protect yourself from crimes and stuff.\nYou money is now {await seco.get_balance(ctx.author.id)}")
@bot.command()
@commands.cooldown(1,86400,commands.BucketType.user)
async def daily(ctx):
premium = discord.utils.get(ctx.guild.roles,id=783611129942638593)
for x in ctx.guild.members:
if premium in ctx.author.roles:
await seco.add_balance(ctx.author.id,100000)
await ctx.send("There ya go! You")
else:
await ctx.send("Hang up there! You don\'t boost the server! Go boost it and you\'ll get this perk")
@bot.command()
@commands.cooldown(1,604800)
async def weekly(ctx):
await seco.add_balance(ctx.author.id,1000000)
await ctx.send(f"You have more money now. Your money is {await seco.get_balance(ctx.author.id)}")
@bot.command()
async def inv(ctx):
user = await seco.get("shop",userid=ctx.author.id)
if user is None:
await seco.insert("shop",userid=ctx.author.id,shield=0,cookie=0,bless=0,wander=0,laptop=0,server=0,banhammer=0,snow=0)
await ctx.send("You have Nothing")
else:
user = await seco.get("shop",userid=ctx.author.id)
shield = user["shield"]
cookie = user["cookie"]
bless = user["bless"]
wander = user["wander"]
laptop = user["laptop"]
server = user["server"]
banhammer = user["banhammer"]
snow = user["snow"]
await ctx.send(f"You have\nShield : {shield}\nCookie : {cookie}\nBlessing : {bless}\nWander : {wander}\nLaptop : {laptop}\nServer : {server}\nBan Hammer : {banhammer}\nSnow : {snow}")
@bot.command()
async def shop(ctx,item=None,amount=1):
if item is None:
embed = discord.Embed(name="**We have available items!**")
embed.add_field(name="Shield",value="This item will protect you from robber and protect you from cops!\n**Cost** 2000 $")
embed.add_field(name="Cookie",value="YUM!\n**Cost** 10 $")
embed.add_field(name="Blessing",value="Bless your money at randomized price\n**Cost** 800000 $")
embed.add_field(name="Wander",value="BOBITY BABOEY BITCHITY BOO! MONEY GOES BRR\n**Cost** 1000000 $")
embed.add_field(name="Laptop",value="Work\n**Cost** 46200 $")
embed.add_field(name="Server",value="Work in another way\n**Cost** 201520 $")
embed.add_field(name="Ban Hammer",value="Make someone can\'t do anything for 120 seconds\n**Cost** 20163029 $")
embed.add_field(name="Snow",value="Stunt someone for 30 seconds")
await ctx.send(embed=embed)
return
if not item.lower() in await seco.get("shop",userid=ctx.author.id):
await ctx.send("Item isn\'t exist what da hecc are you looking for.")
@bot.command()
async def ping(ctx):
print(bot.latency);print(bot.latency * 1000)
await ctx.send(f"My latency is {int(bot.latency * 1000)}")
# this is our loop quests
async def startrandom(ctx):
quest = random.randint(1,3)
if quest is 1:
print("Type a word")
word = ["Jesus","Anime","Discord","TV","Apple","Bon Appetite","Giveaway"]
ran = random.choice(word)
embed = discord.Embed(title=f"Quick! Type {ran}")
await ctx.send(embed=embed)
while True:
try:
msg = await bot.wait_for('message', check=lambda message: message.guild.id == ctx.guild.id,timeout=15)
except Exception:
await ctx.send(embed=discord.Embed(title="Time out!"))
if msg.author == bot.user:
return
if msg.content == ran:
money = random.randint(1,1000)
leaderboardinfo = await seco.leaderboard()
for person in leaderboardinfo:
if str(ctx.author.id) in person["userid"]:
personlb = leaderboardinfo.index(person)
break
await ctx.send(embed=discord.Embed(title=f"{msg.author.name} Won!",description=f"Now {msg.author.name} is at {personlb} and won {money}$\nNow {msg.author.name} have {await seco.get_balance(msg.author.id)}$"))
await seco.add_balance(ctx.author.id,money)
break
else:
await ctx.send("*N O*")
await asyncio.sleep(3600)
if quest is 2:
print("Add reaction")
embed = discord.Embed(title="Add the Reaction Fast!!!")
await ctx.send(embed=embed)
def check(u,r):
return u.message.guild.id == ctx.guild.id
try:
msg = await bot.wait_for('reaction_add', check=check,timeout=30)
except Exception:
await ctx.send(embed=discord.Embed(title="Time Out!"))
money = int(random.randint(1,1000))
await seco.add_balance(ctx.author.id,money)
leaderboardinfo = await seco.leaderboard()
for person in leaderboardinfo:
if str(ctx.author.id) in person["userid"]:
personlb = leaderboardinfo.index(person)
break
await ctx.send(embed=discord.Embed(title=f"{msg[1].name} Won!",description=f"Now {msg[1].name} is at {personlb} and won {money}$\nNow {msg[1].name} have {await seco.get_balance(msg[1].id)}$"))
await asyncio.sleep(3600)
if quest is 3:
"""Hello"""
print("Unscramble shit")
word = ["Jesus","Anime","Discord","TV","Apple","BonAppetite","Giveaway"]
ran = random.choice(word)
wordlist = list(ran)
print(wordlist)
print(ran)
randomized = random.sample(wordlist,len(wordlist))
if randomized == ran:
randomized = random.sample(wordlist,len(wordlist))
joined = ''.join(randomized)
embed = discord.Embed(title="Unscramble Time!",description=f"The word that you need to unscramble is {joined}")
await ctx.send(embed=embed)
while True:
try:
msg = await bot.wait_for('message', check=lambda message: message.guild.id == ctx.guild.id,timeout=15)
except Exception:
await ctx.send(embed=discord.Embed(title="Time out! >:("))
if bot.user == msg.author:
return
if msg.content == ran:
money = random.randint(1,1000)
await seco.add_balance(ctx.author.id,money)
leaderboardinfo = await seco.leaderboard()
for person in leaderboardinfo:
if str(ctx.author.id) in person["userid"]:
personlb = leaderboardinfo.index(person)
break
await ctx.send(embed=discord.Embed(title=f"{msg.author.name} Won!",description=f"Now {msg.author.name} is at {personlb} and won {money}$\nNow {msg.author.name} have {await seco.get_balance(msg.author.id)}$"))
break
else:
await ctx.send("*N O* That\'s not right word")
@bot.command()
@commands.has_permissions(administrator=True)
async def start(ctx):
asyncio.create_task(startrandom(ctx))
await ctx.send("Task Created! Every Hour In This Channel will have random quest!")
import os
import a
a.a()
bot.run("bottoken")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment