Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Imports
- from replit import db
- import discord
- from discord.ext import commands
- import os
- import random
- import json
- from keep_alive import keep_alive
- import time
- keep_aliveVal = 0
- TOKEN = os.environ['BOT_TOKEN']
- ## Prefix
- bot = commands.Bot(command_prefix="/",intents=discord.Intents.all())
- ## Removes default commands
- bot.remove_command('help')
- ## Adds new default commands
- ## Examples
- @bot.command()
- async def hello(ctx):
- TimesUsed = db[ctx.message.author,1]
- db[ctx.message.author,1]
- await ctx.channel.send(ctx.author.mention," has used this command ",TimesUsed," Times")
- @bot.command()
- async def help(ctx):
- embed = discord.Embed(title="Help Command!", description="'test' - a test command", color=discord.Color.random())
- await ctx.channel.send(embed=embed)
- @bot.command()
- async def test(ctx):
- await ctx.channel.send("This is a test command!")
- ## Run
- # Keeps bot running for one hour then the bot automatically turns off
- keep_alive()
- bot.run(TOKEN)
Advertisement
Add Comment
Please, Sign In to add comment