0% found this document useful (0 votes)
29 views3 pages

Discord Bot Commands Implementation

This document contains a Python script for a Discord bot using the discord.py library. The bot features several commands such as 'ping', 'hello', and various interactive commands like '8ball', 'gayrate', and 'hotpercentage', which provide responses based on user input. Additionally, it includes functionality for syncing commands within a specific guild and sending embedded messages.

Uploaded by

RazeYt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views3 pages

Discord Bot Commands Implementation

This document contains a Python script for a Discord bot using the discord.py library. The bot features several commands such as 'ping', 'hello', and various interactive commands like '8ball', 'gayrate', and 'hotpercentage', which provide responses based on user input. Additionally, it includes functionality for syncing commands within a specific guild and sending embedded messages.

Uploaded by

RazeYt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

import discord

from [Link] import commands


from discord import app_commands
from discord import Color
from dotenv import load_dotenv
import os
import random

load_dotenv()

TOKEN = [Link]('TOKEN')

intents = [Link]() # the intents parameter is crucial for


defining what events your bot can listen to and react to
[Link] = True # Basically permissions for your bot.
intents.message_content = True
[Link] = True
[Link] = True

bot = [Link](command_prefix='.', intents=intents) # Cmd syntax + intents


=intents means to pass the intents to bot/client

@[Link]
async def on_ready():
print(f'Logged in as {[Link]} (ID: {[Link]})') # this is called
when the bot has successfully connected to Discord and is ready to operate

try:
GUILD = [Link](id=1339005915742867526)
synced = await [Link](guild=GUILD)
print(f'commands synced.') # Forces the bot to develop within the guild
server and to sync everything

except Exception as e:
print(f'error syncing commands: {e}')

print('------')

# Includes details about the message, channel, guild, and user that triggered the
command.
@[Link]()
async def ping(ctx): # CTX Provides information about the command's invocation
context
await [Link]('Pong!') # Waits for the message to be sent before proceeding
await [Link]()

@[Link]()
async def hello(ctx):
await [Link]('Hello there!')
await [Link]() # Function that sends hello message when u
type .hello

GUILD_ID = [Link](id=1339005915742867526) # THIS WILL BE USED TO MAKE SURE


OUR TESTING IS ONLY IN OUR SERVER AND NOT GLOBAL

@[Link](name="8ball", description="Consult 8ball to receive an answer.",


guild=GUILD_ID)
@app_commands.describe(question="The question you want answers to.")
async def askQuestion(interaction: [Link], question: str): #
Represents the interaction event, Specifies that users must provide a question, and
adds a parameter.
responses = ["Reply hazy, try again",
"signs point to a yes",
"yes",
"no",
"maybe",
"no... baka",
"yuh fosho",
"Sure, Without a doubt",
"maybe man idk lol",
"Outlook not so good",
"You'll be the judge",
"Might be possible",
"How bout u stfu Nigger",
"Shut up and suck my cock",
"You're not ohio blud",
"STFU ALREADY MAN PLEASE"]

answer = [Link](responses)
await [Link].send_message(f"🎱 **Question:** {question}\
n**Answer:** {answer}")

@[Link](name="gayrate", description="Rates how gay someone is.",


guild=GUILD_ID)
@app_commands.describe(user="The user you want to rate, leave empty to rate
yourself")
async def gayRate(interaction: [Link], user: [Link] = None): #
it makes the parameter optional as in any1 in server or urself.
if user is None:
user = [Link]
rating = [Link](0, 100)
if rating < 40:
emoji = "🔥"
elif rating < 70:
emoji = "🤑"
else:
emoji = ""
await [Link].send_message(f"**{[Link]}** is **{rating}%** gay!
{emoji}")

@[Link](name="hotpercentage", description="Rates how hot someone is",


guild=GUILD_ID)
@app_commands.describe(user="The user you want to rate, leave empty to rate
yourself")
async def hotCalc(interaction: [Link], user: [Link] = None):
if user is None:
user = [Link]
rating = [Link](0, 100)
if rating < 40:
emoji = "🤮"
elif rating < 70:
emoji = "💗"
else:
emoji = "😍"
await [Link].send_message(f"**{[Link]}** is **{rating}%** hot
{emoji}")

@[Link](name="coinflip", description="flips a coin", guild=GUILD_ID)


async def coinFlip(interaction: [Link]):
responses = ["Heads", "Tails"]
headstails = [Link](responses)
await [Link].send_message(f"{headstails}")

@[Link](name="fakenitro", description="Claim a free gift!",


guild=GUILD_ID)
async def fakeNitroEmbed(interaction: [Link]):
hex_color = int('CFD2F5', 16)
embed = [Link](title="**You've been gifted a subscription!**",
description="You've been gifted Nitro for **1 month!**", color=hex_color)
embed.set_thumbnail(url="[Link]
1313160789611380756/1349081838236471356/nitro_logo.jpeg?
ex=67d1cdde&is=67d07c5e&hm=fc1be4e4eb3b42a4e6b20322e4b2273265344b17b10e6486a5ac8a4e
d3a881e7&=&format=webp&width=436&height=436")
embed.set_footer(text="Its not real Or is it ? Find out now...")
await [Link].send_message(embed=embed)

class view([Link]):
@[Link]()

[Link](TOKEN)

You might also like