Giter Club home page Giter Club logo

bumpcord's Introduction

BumpCord

A code that can make an account bump your discord server 24/7!


The main.py is the main file. keep_alive.py prevents your repl from going to sleep. (If you have a replit hacker plan, then you can delete keep_alive.py and paste this code inside the main.py file :


import discord, datetime
from asyncio import sleep
import os

channel_id = CHANNEL_ID

class Client(discord.Client):
    active = True

    async def pauseBump(self):
        self.active = False
        print("Bump paused.")

    async def clean(self, user_message=None, bot_message=None):
        await sleep(3)
        if user_message is not None:
            await user_message.delete()
        if bot_message is not None:
            await bot_message.delete()
        print("Chat cleaned.")

    async def continueBump(self):
        self.active = True
        print("Bump restored.")

    async def send(self, ctx, content):
        message = await ctx.channel.send(f"{ctx.author.mention} {content}")
        print(f"Sent '{content}' to '{ctx.author}'")
        await self.clean(ctx, message)

    async def bumpCheck(self):
        channel = self.get_channel(channel_id)
        async for message in channel.history(limit=50):
            if str(message.author) == "DISBOARD#2760":
                if "Bump done" in message.embeds[0].description:
                    now = datetime.datetime.utcnow()
                    two = datetime.timedelta(hours=2)
                    min = datetime.timedelta(minutes=1)

                    difference = now - message.created_at
                    difference = two - difference + min
                    print(f"Time until next bump {difference}")

                    return difference.seconds
                    break

    async def bump(self):
        self.diff = await self.bumpCheck()
        await sleep(self.diff)
        channel = self.get_channel(channel_id)
        command = await channel.send("!d bump")
        print("Server bumped")
        return command

    async def on_ready(self):
        print(f"Logged as {self.user}")
        while self.active == True:
            command = await self.bump()
            await self.clean(command)

    async def on_message(self, message):
        if message.author == self.user:
            if message.content == "!pause":
                await self.pauseBump()
                await self.send(message, "Bot is paused :sleeping:")

            elif message.content == "!continue":
                await self.continueBump()
                await self.send(
                    message,
                    f"Bump is activated, next bump in {self.diff} seconds :hourglass_flowing_sand:",
                )

Client().run(os.getenv("TOKEN"), bot=False)

This Code is from this tutorial. If you have any doubts regarding this, feel free to contact me through my Discord Server.

DO NOT GIVE YOUR TOKEN TO OTHERS!

Use uptimerobot.com to make your repl online 24/7.


⭐ Feel free to Star the Repository if this helped you! ;)


BumpCord © 2021 by SealedSaucer is licensed under Attribution 4.0 International

bumpcord's People

Contributors

sealedsaucer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.