Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import discord
- import os
- from asyncio import sleep
- from time import time
- client = discord.Client(self_bot=True)
- bumping = False
- disboard = 321165645490421760
- class Bump:
- def __init__(self):
- self.start = 0
- self.stop = 0
- self.minutes = 0
- Bumping = Bump()
- async def bump(ctx, seconds):
- bumping = True
- Bumping.start = round(time())
- Bumping.stop = round(Bumping.start) + seconds
- Bumping.minutes = int((Bumping.stop - Bumping.start)/60)
- await ctx.channel.send("Bumping in **{}** minutes".format(Bumping.minutes))
- await sleep(seconds)
- await ctx.channel.send("!disboard bump")
- bumping = False
- Bumping.start = 0
- Bumping.stop = 0
- Bumping.minutes = 0
- @client.event
- async def on_connect():
- print("[!] User: {}".format(client.user.name))
- print("[!] ID: {}".format(client.user.id))
- print(round(time()))
- @client.event
- async def on_message(ctx):
- seconds = 0
- if ctx.author.id == disboard:
- msg = ctx.content.split()
- for word in msg:
- if "**" in word:
- seconds = int(word.strip("*")) * 60
- if not bumping:
- await bump(ctx, seconds)
- elif ctx.author.id != client.user.id and ctx.content == "!a":
- if Bumping.start > 0:
- seconds = int((Bumping.stop - time())/60)
- await ctx.channel.send("**{}** minutes until the next bump".format(seconds))
- else:
- await ctx.channel.send("Welp")
- token = os.environ.get("DISCORD_BOT_SECRET")
- client.run(token)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement