#discord-bots

1 messages · Page 131 of 1

slate swan
#
  count = View()
  count = count.remove_item(count)
  count = count.add_item(select)

  await ctx.send("test menus", view=count)
#

someone pls help me remove the button

dry kelp
#

after saving the user OAuth2 token for a user after allowing me to use guilds.join how can i make the user join back to the guild?

sick birch
#

You misspelled field

#

line 25

#

It's spelled field

stark zenith
#

when a ticket is opened via ticket tool i want my bot to copy the id i send so i can add the person to the ticket, this is how far i came anything i can fix? because it wont run

smoky patrol
#

how can do something like this in my phynton program, when a task finishs:

  1. succes
  2. succes
slate swan
naive briar
unkempt canyonBOT
#

@after_loop```
A decorator that registers a coroutine to be called after the loop finishes running.

The coroutine must take no arguments (except `self` in a class context).

Note

This coroutine is called even during cancellation. If it is desirable to tell apart whether something was cancelled or not, check to see whether [`is_being_cancelled()`](https://discordpy.readthedocs.io/en/latest/ext/tasks/index.html#discord.ext.tasks.Loop.is_being_cancelled "discord.ext.tasks.Loop.is_being_cancelled") is `True` or not.
north prairie
#

anyone know if the command invocation can be stopped in before_invoke

shrewd merlin
#

Hey I need some help, as I don't know what to do for using python to insert data into SQL db

#

most stuff I find is from years ago, and their code doesnt work anymore

slate swan
abstract onyx
#

I love the guy in your pfp

potent spear
#

Aladdin has always been my idol

gritty yacht
#

!d discord.ui.Button

unkempt canyonBOT
#

class discord.ui.Button(*, style=<ButtonStyle.secondary: 2>, label=None, disabled=False, custom_id=None, url=None, emoji=None, row=None)```
Represents a UI button.

New in version 2.0.
open yoke
#

whats the best library to make discord bots with?

slate swan
open yoke
slate swan
#

it’s back to being maintained

open yoke
hushed galleon
#

you're not the first to have mistaken dpy for having been discontinued, but i would have thought itd be pretty well known after several months

#

dpy v2.1 actually came out today as well

open yoke
mighty pilot
#

it doesnt help that if you google discord.py the first result says it stopped being updated

hushed galleon
#

hm it just shows the dpy docs for me

open yoke
#

I was searching up how to do slash commands with it

#

and it said it doesn't support it and never will because it got discontinued

hushed galleon
#

or if you still want an alternative you can look at disnake, nextcord, or hikari

open yoke
#

I was looking at interactions earlier

mighty pilot
#

i have a problem with my giveaway bot. i have it set to add the members who reacted to the giveaway to a list, and based on your roles you can have additional entries by adding your name to said list multiple times. however, when i pull random.sample() from the list of entries, it still gives duplicates even though sample isnt supposed to give duplicates

open yoke
#

How would I make slash commands with it though lol

hushed galleon
mighty pilot
#

which results in multiple of the same winner when i want more than one winner

#

maybe ill have to make a new list from the first list by grabbing a random element and if it already exists in the second list, try again?

#

just seems like a lot of shenanigans to not get duplicates with my sample

hushed galleon
#

huh, random.sample doesnt support specifying weights for each element

mighty pilot
#

yea all it does is which list youre sampling and how many to pull afaik

pliant gulch
#

random.sample then cast to set to remove duplicates

mighty pilot
#

now full circle, is why i weighted the list with duplicates lol

mighty pilot
slate swan
#
 if choice.value == 1:
    with open("users.json", "r") as f:
      users = json.load(f)
    await reset_money(users, interaction.user, member)
    with open("users.json", "w") as f:
      f.dump(users, f)
    reset = discord.Embed(title=f'Reset {member}', description=f"{member}'s Money has been set to 0!")
    await interaction.response.send_message(embed=reset, ephemeral=True)
#

why is this resetting my json file?

pliant gulch
mighty pilot
#

if i want 5 winners, pull a sample of 5, then remove the 2 duplicates im left with 3 total instead of 5

slate swan
pliant gulch
#

You could call sample again with the delta size or whatever

mighty pilot
#

hmmm ill give that a try

hushed galleon
#

many have suffered from the mistakes of one youtube guide

mighty pilot
#

LOL

pliant gulch
#

!e ```py
from random import choices

entries: dict[int, int] = {}
for i in range(10):
entries[i] = i*2 # pseudo entry

print(entries)

def select() -> list[int]:
return choices(list(entries.keys()), weights=list(entries.values()), k=5)

print(select())

#

@mighty pilot cc

#

Keep in mind you still need to filter for duplicates

unkempt canyonBOT
#

@pliant gulch :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | {0: 0, 1: 2, 2: 4, 3: 6, 4: 8, 5: 10, 6: 12, 7: 14, 8: 16, 9: 18}
002 | [5, 4, 9, 7, 3]
slate swan
#

!e

unkempt canyonBOT
#
Missing required argument

code

#
Command Help

!eval [python_version] <code, ...>
Can also use: e

Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside of them.

By default your code is run on Python's 3.11 beta release, to assist with testing. If you run into issues related to this Python version, you can request the bot to use Python 3.10 by specifying the python_version arg and setting it to 3.10.

We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!

slate swan
#

!e
print('e")

unkempt canyonBOT
#

@slate swan :x: Your 3.11 eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     print('e")
003 |           ^
004 | SyntaxError: unterminated string literal (detected at line 1)
slate swan
#

!e
print('hey')

unkempt canyonBOT
#

@slate swan :white_check_mark: Your 3.11 eval job has completed with return code 0.

hey
slate swan
#
    with open('inv.json', 'w') as f:
      json.dump(users, f)
mighty pilot
pliant gulch
#

It's a lot better than what you had though

#

You're method was a lot more memory intensive becuse it requires duplicated entries in the list

mighty pilot
#

Well I have it working just need to filter duplicates

pliant gulch
#

whereas you can get a minimal footprint with a dictionary

mighty pilot
#

I'm not worried about memory I have a rack server in my house lmaoDial and this is the only bot currently running on this VM

hushed galleon
# slate swan i didnt watch a yt vid

but there is one particular youtube video about creating an economy bot that uses json in the same way that you do, and that others have copied while they followed along

slate swan
mighty pilot
#

Point being: I think I'm just gonna use what I have and filter for duplicates since it's already set to add users to the list multiple times for various roles and it already prints the users who entered without duplicates etc

slate swan
#

I need help with making something global

hushed galleon
#

json errors arent really related here, id ask in a help channel

mighty pilot
#

If you want something to be global just don't specify a guild

hushed galleon
#

in general, repeatedly writing data to just a bare file has a higher risk of corruption than a database

pliant gulch
#

inb4 writing 1000 new entries to your JSON file and there is a power outage

pliant gulch
#

Good thing I remembered to use rync instead of mv in my arch install when I was moving home mounts

#

Reminds me of that

slate swan
#
async def add_word(guilds, guild):
  word = client.word
  word2 = f"'{word}', "
  guilds[f'{guild.id}']['words'] + word2

@client.command()
async def test1(ctx, word):
  with open("serverconfigs.json") as f:
    guilds = json.load(f)
  client.word = word
  await add_word(guilds, ctx.guild)
  with open("serverconfigs.json") as f:
    json.dump(guilds, f)
client.word = ''
#
Traceback (most recent call last):
  File "/home/runner/game-bot/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 190, in wrapped
    ret = await coro(*args, **kwargs)
  File "main.py", line 1825, in test1
    json.dump(guilds, f)
  File "/nix/store/2vm88xw7513h9pyjyafw32cps51b0ia1-python3-3.8.12/lib/python3.8/json/__init__.py", line 180, in dump
    fp.write(chunk)
io.UnsupportedOperation: not writable

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/runner/game-bot/venv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 1347, in invoke
    await ctx.command.invoke(ctx)
  File "/home/runner/game-bot/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 986, in invoke
    await injected(*ctx.args, **ctx.kwargs)  # type: ignore
  File "/home/runner/game-bot/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 199, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: UnsupportedOperation: not writable
pliant gulch
#

You need to open the file pointer with "w" to make it write-able

#

Also does add_word really need to be a coroutine function? Everything inside of that coroutine function is atomic

hard trail
#

Trying to make a simple application command and the embed is not being sent to the channel. Been a while in discord.py

@bot.command()
async def app(ctx):
  await ctx.author.send("Discord Username ")
  DiscordUser = await bot.wait_for('message')
  
  await ctx.author.send("Age ")
  Age = await bot.wait_for('message')

  await ctx.author.send("Timezone ")
  Timezone = await bot.wait_for('message')

  await ctx.author.send("How long can you moderate per day? ")
  ModerationTime = await bot.wait_for('message')

  await ctx.author.send("Any Experience: ")
  Exp = await bot.wait_for('message')

  await ctx.author.send("Why do you want to become a staff member? ")
  WhyStaff = await bot.wait_for('message')

  await ctx.author.send("Key Positions of being Staff? ")
  KeyPositions = await bot.wait_for('message')

  await ctx.author.send("How can help the server? ")
  HelpServer = await bot.wait_for('message')

  await ctx.author.send("Situation: A mod has commented on your moderating capabilities, what do you do?")
  Sit1 = await bot.wait_for('message')


  await ctx.author.send("Situation: If you fail this application, what would you do")
  Sit2 = await bot.wait_for('message')

  await ctx.author.send("Situation: A person has tried to use bots in general, what do you do?")
  Sit3 = await bot.wait_for('message')

  await ctx.author.send("Situation: A moderator or an admin is abusing their perms, what do you do?")
  Sit4 = await bot.wait_for('message')
#
  await ctx.author.send("What role are you applying for?")
  RoleApplying = await bot.wait_for('message')

  await ctx.author.send("Application Submitted! Your application is being processed and may take a few days so please be patient!")

  appChannel = await ctx.get_channel(1041124949361963089)

  appEmbed = nextcord.Embed(title=f"Application From {ctx.author}", color=nextcord.Color.random())
  appEmbed.add_field(name="Discord Username", value=f"{DiscordUser.content}")
  appEmbed.add_field(name="Age", value=f"{Age.content}")
  appEmbed.add_field(name="Timezone", value=Timezone.content)
  appEmbed.add_field(name="Moderation Time", value=f"{ModerationTime.content}")
  appEmbed.add_field(name="Experience", value=Exp.content)
  appEmbed.add_field(name="Why do you want to become staff", value=f"{WhyStaff}")
  appEmbed.add_field(name="Key Position of Staff", value=f"{KeyPositions.content}")
  appEmbed.add_field(name="How can you help the server?", value=f"{HelpServer.content}")
  appEmbed.add_field(name="Situation: A mod has commented on your moderating capabilities, what do you do?", value=f"{Sit1.content}")
  appEmbed.add_field(name="Situation: If you fail this application, what would you do", value=f"{Sit2.content}")
  appEmbed.add_field(name="Situation: A person has tried to use bots in general, what do you do?", value=f"{Sit3.content}")
  appEmbed.add_field(name="Situation: A moderator or an admin is abusing their perms, what do you do?", value=f"{Sit4.content}")
  appEmbed.add_field(name="Applying for Role", value=f"{RoleApplying.content}")

  await appChannel.channel.send(appEmbed=appEmbed)
slate swan
#

whats the error

#

client.get_channel()

#

im pretty sure

dull terrace
#

yeah it should be client or bot

slate swan
#
@client.command()
async def test1(ctx, word):
  with open("serverconfigs.json", "r") as f:
    guilds = json.load(f)
  client.word = word
  await add_word(guilds, ctx.guild)
  with open("serverconfigs.json", "w") as f:
    json.dump(guilds, f)

now this isnt writing in the file

slate swan
#

well know I got it to work

#
{
  "cursewords": [
    "curse1", 
    "curse2", 
    "curse3", 
    "curse4", 
    "curse5"
    ]
}

how can I get my json like this

dull terrace
#

guilds[f'{guild.id}']['words'] + word2 this line isn't doing anything

slate swan
#

{"1041109270931972096": {"words": "'hi', 'bell', "}

slate swan
dull terrace
#

why are you defining client.word when you could just pass the word to the function

slate swan
#

i have no idea

dull terrace
#

that's a dictionary of lists

#

do you understand how dictionaries and lists work?

slate swan
#

not rlly

#
def save_stats(stats):
    with open('stats.json', 'w') as f:
        json.dump(stats, f, indent=4))
if authorid {'bye'} in log_data:
            log_data[str(message.author.id)]['bye'] += 1
            save_stats(log_data)
dull terrace
#

!e

my_data = {
    "jeff": [
        1, 
        2, 
        3
    ]
}

# add a key to this dictionary 
my_data["bob"] = [2, 3, 4]

# access a key in a dictionary and add an item to a list
my_data["jeff"].append(420)

# printing to show you the new dictionary
print(my_data)
unkempt canyonBOT
#

@dull terrace :white_check_mark: Your 3.11 eval job has completed with return code 0.

{'jeff': [1, 2, 3, 420], 'bob': [2, 3, 4]}
waxen igloo
#

how could i disable ban_members permission on a role via bot

slate swan
dull terrace
#

dictionary = {"key": "value"}

#

list = ["a", "list", "of", "things"]

#

!e

dictionary = {"bob": 1}
#accessing a dictionary
print(dictionary["bob"])

lst = ["index 0", "index 1"]
#accessing a list
print(lst[0])
unkempt canyonBOT
#

@dull terrace :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | 1
002 | index 0
abstract kindle
#

so if you use commands.Bot() it already comes with a tree, right

#

if so, how would I access the decorator @tree.error

torn sail
#

bot being an instance of commands.Bot

abstract kindle
#

u know im kinda dumb

mighty yarrow
#

@client.command()
async def logoutt(ctx):
if message.author.id == 625899639077339140:
await ctx.message.delete()
author = ctx.message.author
await ctx.bot.logout()

#

help

primal token
#

change message to ctx

#

and no need for ctx here ctx.bot.logout you can just use client

mighty yarrow
cold frigate
#

how do i make my bot listen for and copy discord ids

primal token
#

its client not cilent

mighty yarrow
#

Ciline.close?

cold frigate
#

like i want to paste a id and i want my bot to just copy the id i send howvwer it cant be a command

mighty yarrow
#

oh wtf sorry

#

im dumb

primal token
#

nah its ok haha

primal token
#

Or you can also have a suffix and a check that checks the authors id

mighty yarrow
#

you are really cool

#

no one ever give me short answer like this

primal token
#

:D

primal token
cold frigate
#

well it will but idk how to do it

#

might just use wait_for

primal token
#

Just a simplified version

slate swan
#

how to check for the member inviter ? (on_member_join)

cold frigate
#

i want to paste an id and my bot just copy what i pasted

primal token
#

Why exactly? Yes, that does what you want just with a suffix to identify the special message?

cold frigate
#

i just need it to

mighty yarrow
primal token
unkempt canyonBOT
mighty yarrow
#

if i want to add someone id

primal token
#

Where do you want to add the id exactly? a container object?

mighty yarrow
#

how can i just add it 1line

primal token
#

You can have a global check

#

!d discord.ext.commands.Bot.check

unkempt canyonBOT
#

@check```
A decorator that adds a global check to the bot.

A global check is similar to a [`check()`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check") that is applied on a per command basis except it is run before any command checks have been verified and applies to every command the bot has.

Note

This function can either be a regular function or a coroutine.

Similar to a command [`check()`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check"), this takes a single parameter of type [`Context`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Context "discord.ext.commands.Context") and can only raise exceptions inherited from [`CommandError`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.CommandError "discord.ext.commands.CommandError").

Example...
mighty pilot
primal token
unkempt canyonBOT
#

@discord.ext.commands.is_owner()```
A [`check()`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check") that checks if the person invoking this command is the owner of the bot.

This is powered by [`Bot.is_owner()`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Bot.is_owner "discord.ext.commands.Bot.is_owner").

This check raises a special exception, [`NotOwner`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.NotOwner "discord.ext.commands.NotOwner") that is derived from [`CheckFailure`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure").
primal token
#

you can also use this

mighty yarrow
#

@discord.ext.commands.is_owner()

slate swan
#
@mt.tree.command(name='profile', description='Check yours or a foes profile!')
@app_commands.describe(user='Provide a user (optional)')
@app_commands.describe(hide='Hide from other users?(yes by default)')
@app_commands.choices(hide=[
  discord.app_commands.Choice(name='Yes', value=1),
  discord.app_commands.Choice(name='No', value=2),
])
async def profile(interaction: discord.Interaction, user: discord.Member=None, hide: discord.app_commands.Choice[int]=1):
  if user == None:
    user = interaction.user
    with open("users.json", "r") as f:
      users = json.load(f)
    await update_mny(users, interaction.user)
    with open("users.json", "w") as f:
      json.dump(users, f)
    with open("lvl.json", "r") as f:
      users = json.load(f)
    await update_lvl(users, interaction.user)
    with open("lvl.json", "w") as f:
      json.dump(users, f)    
  if hide.value == 1:
    profile = discord.Embed(title=f"{user}'s Profile")
    await interaction.response.send_message(embed=profile, ephemeral=True)
  if hide.value == 2:
    profile = discord.Embed(title=f"{user}'s Profile")
    await interaction.response.send_message(embed=profile)
#
Traceback (most recent call last):
  File "/home/runner/miner-bot/venv/lib/python3.8/site-packages/discord/app_commands/commands.py", line 862, in _do_call
    return await self._callback(interaction, **params)  # type: ignore
  File "main.py", line 62, in profile
    if hide.value == 1:
AttributeError: 'int' object has no attribute 'value'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/runner/miner-bot/venv/lib/python3.8/site-packages/discord/app_commands/tree.py", line 1242, in _call
    await command._invoke_with_namespace(interaction, namespace)
  File "/home/runner/miner-bot/venv/lib/python3.8/site-packages/discord/app_commands/commands.py", line 887, in _invoke_with_namespace
    return await self._do_call(interaction, transformed_values)
  File "/home/runner/miner-bot/venv/lib/python3.8/site-packages/discord/app_commands/commands.py", line 880, in _do_call
    raise CommandInvokeError(self, e) from e
discord.app_commands.errors.CommandInvokeError: Command 'profile' raised an exception: AttributeError: 'int' object has no attribute 'value'
mighty yarrow
primal token
mighty yarrow
#

where do i add it xD

#

on topr ight

primal token
#

On top of the commands you want especially for you

mighty yarrow
#

can i use user id instead

primal token
#

You can use it for the specific commands, if you want all the commands use the global check

mighty yarrow
# primal token You can use it for the specific commands, if you want all the commands use the g...

@commands.command()
@commands.check(add_Mod)
async def add_Mod(ctx, user:discord.Member=None):
if user == None:
await ctx.send("Please provide a user to add as a Mod!")
return

# First we'll make some functions for cleaner, more readable code #

def is_Mod(user_id): 
## This function will check if the given id is already in the file. True if in file, False if not ##
    with open('Mod.txt', 'r') as f:
        if str(user_id) in f.read():
            return True
        else:
            return False

def add_Mod(user_id):
## This function will add the given user id into the given text file, Mod.txt ##
    with open('Mod.txt', 'a') as f: # 'a' is used for appending, since we don't want to overwrite all the ids already in the file
        f.write(f"{str(user_id)}\n")
        f.close()

# Now we put those functions to use #
if is_Mod(user.id) == True:
    await ctx.send(f"The user {user} is already a Mod!")
else:
    add_Mod(user.id)
    await ctx.send(f"{user} added as a Mod!")
primal token
#

Your code can be restructured better, its quite unreadable and unpythonic and in some parts incorrect

#

And your implementation with txt files are a bit questionable, if you're going to store a bit of data why not making it easier and use JSON?

slate swan
#

!code

#

!code

#

!pastebin

#

for some reason it says level is referenced before assignment if I select a user in the menu

pulsar bridge
#

got it

#

There's the error

#

This is the issue, for anyone who may have an answer

slate swan
#

I want to set my discord bot (made with discord.py) to restart every 10 minutes using os.execv(sys.argv[0], sys.argv) for testing purposes. I'm looking for an equivalent to Tkinter's root.after(milliseconds, command) that waits for a set amount of time before executing a command. Any ideas on how to implement this?

sick birch
mighty pilot
#

does it make sense to add a global leaderboard and global rank command to a leveling bot?

wicked atlas
#

replit projects run on shared machines. this means the IP address your bot is using the discord API from is shared with other people, who are also using the discord API. Cloudflare, the service that protects discord's api from DDoS attacks, sees this large number of requests, and blocks it.

#

It's one of the reasons that replit isn't good for hosting

mighty pilot
wicked atlas
wary crystal
#

All if not most free VPS will be shared instances, I doubt companies really want to fork out the money needed to supply everyone with a free dedicated server

wicked atlas
wary crystal
#

You'll encounter that caveat in most places

mighty yarrow
#

it keep disconnecting everytime

#

replit is bad

wicked atlas
#

yep. Nobody's going to give you free hosting, unless there's some kind of catch

mighty pilot
#

anything free comes at the cost of userability

mighty yarrow
#

uptimerobot

wicked atlas
#

If you want to, you could probably self host it, and run a computer in the corner of your basement or something with the bot running on it

mighty yarrow
#

@wicked atlas

#

cmd is slow

wicked atlas
#

?

wary crystal
#

???

mighty yarrow
#

which ide is fastest?

wary crystal
#

What does IDE have anything to do with hosting?

wicked atlas
wary crystal
#

Repl.it seems to have given a lot of people a huge misconception with what IDEs actually do...

wary crystal
#

IDE is just your editor so to speak, your integrated editing development

mighty yarrow
#

repl.it is faster than cmd and vscode

wary crystal
#

Not a VPS

wicked atlas
mighty pilot
#

idk what editing speed has to do with anything lmao

wicked atlas
#

VSCode is just a text edtior, replit is a website with an editor in it, and cmd is a terminal

wary crystal
#

Basically just a hosted IDE

dense merlin
#

i found the right channel less gooo

mighty pilot
dense merlin
wicked atlas
wicked atlas
#

!intents

unkempt canyonBOT
#

Using intents in discord.py

Intents are a feature of Discord that tells the gateway exactly which events to send your bot. Various features of discord.py rely on having particular intents enabled, further detailed in its documentation. Since discord.py v2.0.0, it has become mandatory for developers to explicitly define the values of these intents in their code.

There are standard and privileged intents. To use privileged intents like Presences, Server Members, and Message Content, you have to first enable them in the Discord Developer Portal. In there, go to the Bot page of your application, scroll down to the Privileged Gateway Intents section, and enable the privileged intents that you need. Standard intents can be used without any changes in the developer portal.

Afterwards in your code, you need to set the intents you want to connect with in the bot's constructor using the intents keyword argument, like this:

from discord import Intents
from discord.ext import commands

# Enable all standard intents and message content
# (prefix commands generally require message content)
intents = Intents.default()
intents.message_content = True

bot = commands.Bot(command_prefix="!", intents=intents)

For more info about using intents, see discord.py's related guide, and for general information about them, see the Discord developer documentation on intents.

dense merlin
mighty yarrow
#

does uptimerobot actually work

wicked atlas
dense merlin
#

idk

wary crystal
#

For what it was meant to do (not hosting bots) yea

dense merlin
wicked atlas
#

if you can get that working reliably, go for it ig. never used a phone as a server :p

wary crystal
#

Make sure to monitor your phone sometimes. It can get really hot

#

If you have a lithium battery it might even be dangerous

mighty pilot
dense merlin
mighty yarrow
#

ur battery?

slate swan
#

How much memory should typically be allocated to hosting a Discord bot 24/7?

mighty pilot
#

how fitting, we were just discussing how unreliable replit is lol

mighty pilot
wary crystal
#

I'm not really talking about your charge times, more so the heat of your phone which could cause some bad side effects

#

As phones don't usually come with fans and what not

#

Which servers usually equip themselves with

mighty yarrow
#

wasting money is better than wasting ur life

wicked atlas
mighty yarrow
#

xD

dense merlin
slate swan
mighty pilot
wary crystal
#

2gb kind of overkill ngl

slate swan
wary crystal
#

Was running in 50 or so servers and my peak was around 40~ mb

dense merlin
#

i also have barely working fans

#

so i cant even run roblox

mighty pilot
mighty yarrow
wicked atlas
dense merlin
slate swan
#

I see, thanks.

mighty yarrow
#

hosting bot on mobile

#

nice idea

#

imma try it

mighty pilot
slate swan
#

My PC has 32GB of memory but sadly I left it at home when I moved out. If I had it with me then I could probably just self-host for the time being.

pliant gulch
mighty pilot
mighty yarrow
#

my vps is slow asf

wicked atlas
dense merlin
# mighty pilot show me what you wrote

import os
from keep_alive import keep_alive
from discord import client,Intents
from discord.ext import commands
from lists import name_list, title_list
from urllib.request import urlopen
from random import randint
intents = Intents.default()
intents.message_content = True

bot = commands.Bot(
command_prefix="u!", # Change to desired prefix
case_insensitive=True, # Commands aren't case-sensitive
intents=intents
)

bot.author_id = 928109349140824125 # Change to your discord id!!!

pliant gulch
wicked atlas
vocal snow
wicked atlas
#

what?

mighty pilot
#

just stop being a nerd then

wicked atlas
pliant gulch
mighty yarrow
#

they removed bot on v.2.0

wicked atlas
dense merlin
pliant gulch
#

But I find it hard to actually imagine someone doing O(n^2) space complexity in a command

wicked atlas
pliant gulch
#

Unless.... they are doing something too omega

slate swan
#

What is O(n^2)?

mighty yarrow
#

pip install discord.py==1.7.3

wicked atlas
wicked atlas
mighty yarrow
#

cuz im using it

slate swan
#

If you're gonna use dpy, use 2.0+.

wicked atlas
#

💀

mighty yarrow
#

no error

slate swan
mighty pilot
#

whoops wrong reply

wicked atlas
mighty pilot
#

nah just playing because theres always someone in here with replit problems lol

mighty yarrow
wicked atlas
mighty pilot
pliant gulch
#

Well you would be right anyways as Gateway 6 has long been deprecated

#

For some reason it's still the default version though ...

wicked atlas
#

yeah idk why that is

#

there must be some reason for that

pliant gulch
#

10-9 are the most current versions right now

mighty yarrow
#

but discord.py had an update 2.0 and they remove self botting u need to downgrade

pliant gulch
#

You should be using 10 if you want the bleeding edge features like some interactions stuff

wicked atlas
#

technically, it's just deprecated, not discontinued

pliant gulch
mighty yarrow
#

@slate swan

slate swan
#

What?

wicked atlas
slate swan
pliant gulch
#

inb4 run nukebot -> 4m later get's locked

#

I doubt with vanilla discord.py you'll be able to selfbot easily anyways

#

Now that discord has the intents user accounts will find it harder to get around to getting messages

slate swan
#

I think we should not be discussing self-bots or nuke-bots. Don't want the mods to get angry MichaelHappyCry

mighty yarrow
#

sarcastic

slate swan
#

Anyways, which VPS services are generally recommended for bot hosting?

mighty pilot
slate swan
#

Wow, thank you guys.

wicked atlas
mighty pilot
oblique laurel
#

How the heck can one be "self hosting on Replit" lol

wicked atlas
#

I remember once I was working on a project with a partner during class and I was bored and started playing around with the shell, and I did rm -rf / --no-preserve-root just for fun to see if it would work. It didn't, but it did delete all of our project.

slate swan
#

how can I mention slash commands

mighty pilot
#

</command name : command ID>

wicked atlas
mighty yarrow
#

hosting bot on mobile phone

wicked atlas
#

no, because it deleted all the files

slate swan
#

and how do I get the cmd id?

mighty yarrow
#

skid nuke lol

#

ur dumb

#

its just empty file

wicked atlas
#

looks like you right click this bar

mighty pilot
#

its great as long as its not wrong

oblique laurel
#

Props to the people who coded stack overflow without using stack overflow

wicked atlas
pliant gulch
oblique laurel
mighty pilot
pliant gulch
mighty pilot
#

fair point. official docs do be official looking

wicked atlas
#

!d discord.Message.mentions

unkempt canyonBOT
#

A list of Member that were mentioned. If the message is in a private message then the list will be of User instead. For messages that are not of type MessageType.default, this array can be used to aid in system messages. For more information, see system_content.

Warning

The order of the mentions list is not in any particular order so you should not rely on it. This is a Discord limitation, not one with the library.

wicked atlas
#

this one?

mighty pilot
#

anybody got a cooldown thats specified per user that would work in an on_message?

unkempt canyonBOT
#

Cooldowns in discord.py

Cooldowns can be used in discord.py to rate-limit. In this example, we're using it in an on_message.

from discord.ext import commands

message_cooldown = commands.CooldownMapping.from_cooldown(1.0, 60.0, commands.BucketType.user)

@bot.event
async def on_message(message):
    bucket = message_cooldown.get_bucket(message)
    retry_after = bucket.update_rate_limit()
    if retry_after:
        await message.channel.send(f"Slow down! Try again in {retry_after} seconds.")
    else:
        await message.channel.send("Not ratelimited!")

from_cooldown takes the amount of update_rate_limit()s needed to trigger the cooldown, the time in which the cooldown is triggered, and a BucketType.

mighty pilot
#

well thats a global cooldown isnt it? im trying to make one for a level system where if that specific user sends a message within 5 seconds of another message it wont register, but other users can still send a message that gets registered

mighty pilot
#

or is that what the bit at the top is for bucket

#

ah yea ok

#

thanks

wicked atlas
mighty pilot
#

im not trying to dive into undocumented territory lol

wicked atlas
#

then you've probably hit a wall

wicked atlas
mighty pilot
#

yea im gonna put that in and see how she goes

azure granite
#
prefix = "!"


client = commands.Bot(command_prefix = prefix , intents = discord.Intents.all())
status = cycle(['gbot is listening'])


@client.command()
async def pat(ctx):
  await ctx.send('bark bark!!')

#

why this is not working anyone

wicked atlas
#

Does it give any errors?

azure granite
#

it just oesnt work

mighty pilot
# unkempt canyon

so in this, the from_cooldown(1.0, 60.0 is that saying one update in 60 seconds?

azure granite
#
import discord
import os
import random
from discord.ext import commands, tasks
from itertools import cycle
import pytz
import time

prefix = "!"


client = commands.Bot(command_prefix = prefix , intents = discord.Intents.all())
status = cycle(['gbot is listening'])


@client.event
async def on_ready():
    await client.change_presence(status=discord.Status.idle, activity=discord.Game('With Your Mom'))
    print("token is online")
    print("")
    time.sleep(0.5)
    print('all systems are booted up , ready to be online !')

@client.event
async def on_message(message):
  if message.author == client.user:
    return()

  if message.content.startswith("!ur on ?"):
    await message.channel.send("Yes Im On , Playing With Ur Mom")

@client.command()
async def role_assign(ctx , message , roles):
  if message.content == roles:
    role = discord.utils.find(lambda m: message == roles, discord.Guild.roles)

  message.channel.send(role.id)

@client.command()
async def pat(ctx):
  await ctx.send('bark bark!!')


my_secret = os.environ['token']
print("booting the system")
print("")
time.sleep(0.5)
print("systems are online")
print("")
client.run(os.getenv("token"))
#
@client.event
async def on_message(message):
  if message.author == client.user:
    return()

  if message.content.startswith("!ur on ?"):
    await message.channel.send("Yes Im On , Playing With Ur Mom")
azure granite
#

yea im running it on replit

mighty pilot
#

doesnt solve problems inside the code though lol

wicked atlas
#

not for this case

azure granite
#

kk

slate swan
azure granite
#

what is this ??

#

okay bro

#

how should i change my server

bright wedge
#
@client.event
async def on_message(message):
  if message.author == client.user:
    return # no parentheses
azure granite
#

okay

fading marlin
#

jeez what? the kill is used to force stop a process with its ID

azure granite
#

btw i like ur pfp

#

keep ddestroying bro

fading marlin
#

don't use replit cause it uses shared IP

#

that's not how it works

azure granite
#

i get that 😂

bright wedge
#

💣python

azure granite
#

where to place this peice of code

bright wedge
#

osama coding timer

abstract kindle
#

heyo how do I get bot in my cog for this decorator?
@bot.tree.error

bright wedge
#

add the bomb too \💣

fading marlin
abstract kindle
#

on my init where

fading marlin
#

your cog's init

abstract kindle
#

i see

#

what do you mean by setting it to a coroutine

unkempt canyonBOT
fading marlin
#

a coroutine is a function that's async

abstract kindle
#
 async def on_app_command_error(self, interaction: discord.Interaction, error: app_commands.AppCommandError):
        if isinstance(error, app_commands.CommandOnCooldown):
            error_embed = discord.Embed(
                title=error,
                color=discord.Color.red())
            await interaction.response.send_message(embed=error_embed)
#

This is the function I am trying to put the decorator on

fading marlin
#

in your init, you gotta set tree.on_error to that coroutine then

#

don't call it though

azure granite
fading marlin
#

you're not calling the decorator

#

@client.command**()**

azure granite
mighty pilot
#

is there a more proper way to exit a chunk of code than doing this: if undesirable: return

azure granite
fading marlin
#

you literally have to type 2 characters ._.

azure granite
#

ohh srry

#

i get it

fading marlin
#

could you elaborate a bit? Errors are raised, they're not typed btw

mighty pilot
fading marlin
#

You can listen to the on_command_error event

pearl inlet
#
@bot.slash_command(description="Buy things!")
async def buy(interaction: nextcord.Interaction, option: str = nextcord.SlashOption(description="Item Name", required=True)):
    p2 = interaction.user.id
    
    with open('Data.json') as json_file:
        json_decoded = json.load(json_file)
    p7 = json_decoded["Data"][str(p2)]["Coins"]
    if option.lower() == "watermelon":
        if (json_decoded["Data"][str(p2)]["Coins"] >= 50):
            json_decoded["Data"][str(p2)]["Potato"] += 1
            msg = await interaction.send(f"Successfully bought watermelon, your balance is now **{p7}** (![rotating_coin](https://cdn.discordapp.com/emojis/1041139664054128780.webp?size=128 "rotating_coin"))!")
    elif option.lower() == "potato":
        if (json_decoded["Data"][str(p2)]["Coins"] >= 100):
            json_decoded["Data"][str(p2)]["Potato"] += 1
            msg = await interaction.send(f"Successfully bought potato, your balance is now **{p7}** (![rotating_coin](https://cdn.discordapp.com/emojis/1041139664054128780.webp?size=128 "rotating_coin"))!")
    else:
        await interaction.send("⚠ Error: Invalid Syntax (Please use /shop for reference!)")

I'm trying to make it so when you put "watermelon" or "potato" into the option it adds one potato or watermleon to the json if they have enough coins
it doesn't send an error but it says the application doesn't respond
no idea what to do next

fading marlin
#

As in the traceback?

mighty pilot
#

just exiting because of the custom rate limit is all. i just wanted it to exit the function and do nothing else

fading marlin
#

print or ctx.send()?

mighty pilot
azure granite
#

im losing my temper

fading marlin
azure granite
#

ohh i seee why

fading marlin
azure granite
#

dayum using api is hard man

fading marlin
#

no, that'll just return the raw string with no additional arguments

mighty pilot
pearl inlet
#

Could you give me an example of literal/choise arguments please?

pearl inlet
azure granite
#

it isnt responing to msg

fading marlin
slate swan
#
Traceback (most recent call last):
  File "main.py", line 306, in <module>
    class View(discord.ui.View):
  File "main.py", line 311, in View
    async def tes(interaction: discord.Interaction):
  File "/home/runner/miner-bot/venv/lib/python3.8/site-packages/discord/app_commands/tree.py", line 889, in decorator
    command = Command(
  File "/home/runner/miner-bot/venv/lib/python3.8/site-packages/discord/app_commands/commands.py", line 685, in __init__
    self._params: Dict[str, CommandParameter] = _extract_parameters_from_callback(callback, callback.__globals__)
  File "/home/runner/miner-bot/venv/lib/python3.8/site-packages/discord/app_commands/commands.py", line 381, in _extract_parameters_from_callback
    raise TypeError(f'callback {func.__qualname__!r} must have more than {required_params - 1} parameter(s)')
TypeError: callback 'View.tes' must have more than 1 parameter(s)
slate swan
# slate swan ```py Traceback (most recent call last): File "main.py", line 306, in <module>...
class View(discord.ui.View):

  def __init__(self, *, timeout: float = 3600.0):
    super().__init__(timeout=timeout)
  @mt.tree.command(name='menu', description='Opens the menu!')
  async def tes(interaction: discord.Interaction):
    select = Select(min_values=1, max_values=1, options=[
    discord.SelectOption(
      label="Profile", emoji='🎲', description='cloudy weather'),
    discord.SelectOption(label="Rainy", description='rainy weather')
  ])
azure granite
#

yea u should focus on america rn

fading marlin
pearl inlet
azure granite
slate swan
azure granite
#

old osama hijacked planes , new osama will be a coder and hack their systems then make 1000s of planes fall

azure granite
#

lee oni-chan help me

fading marlin
mighty pilot
slate swan
#

yea i see now

pearl inlet
slate swan
#

thanks

azure granite
fading marlin
fading marlin
pearl inlet
fading marlin
fading marlin
unkempt canyonBOT
#

await send_message(content=None, *, embed=..., embeds=..., file=..., files=..., view=..., tts=False, ephemeral=False, delete_after=None, allowed_mentions=...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Responds to this interaction by sending a message.
fading marlin
#

that took long enough

#

use a command error handler

slate swan
#

class Dropdown(discord.ui.Select):
    def __init__(self):

        # Set the options that will be presented inside the dropdown
        options = [
            discord.SelectOption(label='Red', description='Your favourite colour is red', emoji='🟥'),
            discord.SelectOption(label='Green', description='Your favourite colour is green', emoji='🟩'),
            discord.SelectOption(label='Blue', description='Your favourite colour is blue', emoji='🟦'),
        ]

        # The placeholder is what will be shown when no option is chosen
        # The min and max values indicate we can only pick one of the three options
        # The options parameter defines the dropdown options. We defined this above
        super().__init__(placeholder='Choose your favourite colour...', min_values=1, max_values=1, options=options)

    async def callback(self, interaction: discord.Interaction):
        # Use the interaction object to send a response message containing
        # the user's favourite colour or choice. The self object refers to the
        # Select object, and the values attribute gets a list of the user's
        # selected options. We only want the first one.
        if self.name == 'Red':
          await interaction.response.send_message("red", ephemeral=True)
Traceback (most recent call last):
  File "/home/runner/miner-bot/venv/lib/python3.8/site-packages/discord/ui/view.py", line 425, in _scheduled_task
    await item.callback(interaction)
  File "main.py", line 325, in callback
    if self.name == 'Red':
AttributeError: 'Dropdown' object has no attribute 'name'
mighty pilot
#

what are you trying to check the name of

sick birch
slate swan
#

lets go!!

slate swan
mighty pilot
#

should either set self.name in the interaction or check for the interaction picked

slate swan
#

i tried
self.value[0]

sick birch
#

Your callback should take select as the 3rd argument:

async def callback(self, interaction: discord.Interaction, select: discord.ui.Select) -> None:
  if select.values[0].name == "Red":
    ...
slate swan
#

oh yea lol

#

another thing...

#

how do i align emojis in an embed

mighty pilot
#

wym

slate swan
#

like
shorter 🔒
short 🔒

#

make them in one line

mighty pilot
#

aside from just adding more spaces? lol

slate swan
#

they dont work in embeds

slate swan
#

oh wait I didnt do send_message right

#

@sick birch

#
        async def callback(self, interaction: discord.Interaction, select: discord.ui.Select) -> None:
          if select.values[0].name == "Red":
            await interaction.response.send_message("Red", ephemeral=True)
#

this doesnt send the message

sick birch
slate swan
#

nothing just says it failed

mighty pilot
#

send_message(content='red', ephemeral=True)

fading marlin
# slate swan

if you want to do it dynamically, you can do something like

f"{'Shovel':8} :lock:"

where you can change 'Shovel' for a string variable. Else, just use spaces

fading marlin
#

I've got no clue how to explain it if I'm being honest. I'm quite newbie to it. F-strings are quite the marble :o

mighty pilot
slate swan
#

i did

#

nothing happens

mighty pilot
#

where did you put it

slate swan
#

replaced the interaction.response.send_message

mighty pilot
#

youre not making it to the send message part

#

thats the point of the print

#

put it before if select.values

#

the line above it

#

below the callback line

#

inline with if

slate swan
#

ok

#

testing

#

nothing

mighty pilot
#

not self.values

slate swan
#

what

mighty pilot
#

select.values

slate swan
#

o

mighty pilot
#

print(select.values)

#

then run it and make a selection

slate swan
#

nothing

mighty pilot
#

did you run the bot and select something from the menu

slate swan
#

yea all 3

sick birch
# slate swan

Are you re-running the command and using the new select menu or are you using an older select menu from before?

slate swan
sick birch
#

I mean, on discord

slate swan
#

no

#

im rerunning the command

sick birch
mighty pilot
slate swan
sick birch
slate swan
#

i alr did

mighty pilot
#

he does on line 318

sick birch
#

That's select.values

slate swan
#

i also did self.values

sick birch
#

Since this is inside a ui.Select subclass

slate swan
#

nothing

abstract kindle
#

@fading marlin

self.bot.tree.on_error = CommandErrorHandler.on_app_command_error
``` Is this what you're talking about?
pearl inlet
#

@fading marlin name 'Literal' is not defined

slate swan
#

@sick birch you good bro?

cold burrow
#

Hi, i get 400 bad request no content whenever i try to send an embed msg, heres my code:

bot.py

        embedMsg = discord.Embed(title=config.TITLE, description=config.DESCRIPTION, color=0x00FFFF)

        if message.content.startswith('test'):
           await message.channel.send(embed=embedMsg)

config.py

TITLE = "test"
DESCRIPTION = "PLACEHOLDER TEXT"
abstract kindle
#
Traceback (most recent call last):
  File "/Users/ellalbrys/PycharmProjects/EconomyDiscordBot/venv/lib/python3.10/site-packages/discord/app_commands/tree.py", line 1089, in wrapper
    await self._call(interaction)
  File "/Users/ellalbrys/PycharmProjects/EconomyDiscordBot/venv/lib/python3.10/site-packages/discord/app_commands/tree.py", line 1244, in _call
    await self.on_error(interaction, e)
TypeError: CommandErrorHandler.on_app_command_error() missing 1 required positional argument: 'error'
``` Trying to create a cooldown. I'm close, but idk how to fix this
slate swan
#

@abstract kindle send code

#

cmd and error handler

abstract kindle
#

Handler

@commands.Cog.listener()
    async def on_app_command_error(self, interaction: discord.Interaction, error: app_commands.AppCommandError):
        if isinstance(error, app_commands.CommandOnCooldown):
            error_embed = discord.Embed(
                title=error,
                color=discord.Color.red())
            await interaction.response.send_message(embed=error_embed)
        else:
            print("error:", error)
#

And the error is just from @app_commands.checks.cooldown(1, 60)

slate swan
#
@commands.Cog.listener()
@cmdname.error
async def on_cmdname_error(interaction: discord.Interaction,
                        error: app_commands.AppCommandError):
  if isinstance(error, app_commands.CommandOnCooldown):
    await interacti
#

try this and replace cmdname with ur cmd name

#

as this slash command wold be sell

upbeat gust
#

use the @tree.error decorator

slate swan
#
class Dropdown(discord.ui.Select):
    def __init__(self):

        # Set the options that will be presented inside the dropdown
        options = [
            discord.SelectOption(label='Red', description='Your favourite colour is red', emoji='🟥'),
            discord.SelectOption(label='Green', description='Your favourite colour is green', emoji='🟩'),
            discord.SelectOption(label='Blue', description='Your favourite colour is blue', emoji='🟦'),
        ]

        super().__init__(placeholder='Zio Miner Menu', min_values=1, max_values=1, options=options)

        async def callback(self, interaction: discord.Interaction, select: discord.ui.Select) -> None:
          print(self.values)
          if select.values[0].name == "Red":
            await interaction.response.send_message("Red", ephemeral=True)

why isnt this printing or responding?

abstract kindle
upbeat gust
#

why not

abstract kindle
#

I would have to access it from bot.tree

#

and I'm in a cog

upbeat gust
abstract kindle
#

Globally

upbeat gust
slate swan
slate swan
#

nothing

#

it doesnt print ether

abstract kindle
#

@upbeat gust perfect, thanks

slate swan
#

@upbeat gust

#

could you help?

#
  view = DropdownView()
  await interaction.response.send_message("", view=view, ephemeral=True)


class Dropdown(discord.ui.Select):
    def __init__(self):
        options = [
            discord.SelectOption(label='Red', description='Your favourite colour is red', emoji='🟥'),
            discord.SelectOption(label='Green', description='Your favourite colour is green', emoji='🟩'),
            discord.SelectOption(label='Blue', description='Your favourite colour is blue', emoji='🟦'),
        ]

        super().__init__(placeholder='Zio Miner Menu', min_values=1, max_values=1, options=options)

        async def callback(interaction: discord.Interaction, select: discord.ui.Select):
          print(options.values)
          if options.values[0].name == "Red":
            await interaction.response.send_message("Red", ephemeral=True)


class DropdownView(discord.ui.View):
    def __init__(self):
        super().__init__()
        self.add_item(Dropdown())
#

this menu doesnt do anything, it doesnt print or send a message

#

-> Running in aa9c07c9cc02
2
An error occurred during configuration: option use-feature: invalid choice: 'content-addressable-pool' (choose from '2020-resolver', 'fast-deps', 'in-tree-build')
3

#

what does that mean

#
@tasks.loop(seconds = 10) # repeat after every 10 seconds
async def myLoop(ctx):
    print("restarting")
    os.system("python bothappy.py")

I added this to my discord bot and I get this error: RuntimeError: no running event loop

slate swan
#
    view = View()
    await interaction.response.send_message(embed=profile2, ephemeral=True, view=view)

question, how can I add the menu into the field?

slate swan
#

got it nvm

loud junco
#

!d discord.Embed.set_image

unkempt canyonBOT
#

set_image(*, url)```
Sets the image for the embed content.

This function returns the class instance to allow for fluent-style chaining.
loud junco
torn sail
#

make sure ur passing it in as a keyword argument

loud junco
#
embed = discord.Embed(
        description= 'Board',
        color = discord.Color.blue())
      embed.set_image('https://static.wikia.nocookie.net/monopoly/images/a/a5/Monopoly_Board_Game_%28UK%29.jpg/revision/latest/scale-to-width-down/1000?cb=20220120173735')
      embed.set_author(name= 'Lobby', 
        icon_url = ctx.author.avatar.url)
      embed.set_footer(text = 'Go grab some drinks')
      await ctx.send(embed=embed)
torn sail
#

embed.set_image(url=…)

loud junco
#

oo

#

thanks

abstract kindle
#

AppCommands don't have a hidden attribute?

slate swan
#

In discord.py, does a view's timeout countdown get reset whenever a user clicks a button in that view, or is it just a single countdown?

#
random_activity = ['Zio Miner', '/help', f'in {len(mt.guilds)} guilds!']
#

why is it saying 0 guilds?

naive briar
#

Anyone can just tell why with just that amount of info, huh

slate swan
#

Thanks

tranquil badge
#
def get_prefix(bot, message):
    prefixes = ['!']
    return commands.when_mentioned_or(*prefixes)(bot, message)


initial_extensions = []

bot = commands.Bot(intents = discord.Intents.all(),
    command_prefix=get_prefix,
    description='Phoenix 2 iOS information bot',
    owner_ids= [352986404621647873])

for filename in os.listdir('./cogs'):
    if filename.endswith (' .py'):
        initial_extensions.append("cogs." + filename[:-3])

async def setup_hook(self):
    for extension in initial_extensions:
        try:
            bot.load_extension(extension)
        except Exception as e:
            print(f'Failed to load extension {extension}.', file=sys.stderr)
            traceback.print_exc()

@bot.event
async def on_ready():
    print('We have logged in as {0.user}'.format(bot))
    try:
        synced = await bot.tree.sync()
        print(f"Synced {len(synced)} command(s)")
    except Exception as e:
        print(e)
    game = discord.Game("Phoenix II")
    await bot.change_presence(status=discord.Status.online, activity=game)
    print(f'Successfully logged in and booted...!')

 
class SimpleCog(commands.Cog, name="Simple Commands"):
    """SimpleCog"""

    def __init__(self, bot):
        self.bot = bot

    @app_commands.command(name="source", description="GitHub repository link")
    async def source(self, interaction: discord.Interaction):
        src = "https://github.com/NinjaPanda263/Roc-Bot"
        await interaction.response.send_message(src)

async def setup(bot):
    bot.add_cog(SimpleCog(bot))

I am having trouble getting my commands in cogs to sync. Working on adding slash commands.

#

please ping if you respond, ty

vale wing
#

Pycord has automatic tree sync doesn't it

#

for command in s: a += 1 what, why not use len(s) lol

#

In pycord the sync is done automatically

#

It's not dpy where you gotta do it manually

vale wing
#

!d discord.app_commands.command is

unkempt canyonBOT
#

@discord.app_commands.command(*, name=..., description=..., nsfw=False, auto_locale_strings=True, extras=...)```
Creates an application command from a regular function.
tranquil badge
#

thats what i had originally. was trying variations

#

still isnt working

vale wing
mighty yarrow
#

how to ignore this error

vale wing
#

You don't need it at all

vale wing
# mighty yarrow how to ignore this error

Listen for on_command_error event

@bot.listen()
async def on_command_error(ctx, error):
    if isinstance(error, commands.CheckFailure):
        # handle
    else:
        raise error```
slate swan
#

hello

#

on this code now but

#

should i remove the intents?

vale wing
#

!rule tos

unkempt canyonBOT
#

5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.

vale wing
#

!ytdl

unkempt canyonBOT
#

Per Python Discord's Rule 5, we are unable to assist with questions related to youtube-dl, pytube, or other YouTube video downloaders, as their usage violates YouTube's Terms of Service.

For reference, this usage is covered by the following clauses in YouTube's TOS, as of 2021-03-17:

The following restrictions apply to your use of the Service. You are not allowed to:

1. access, reproduce, download, distribute, transmit, broadcast, display, sell, license, alter, modify or otherwise use any part of the Service or any Content except: (a) as specifically permitted by the Service;  (b) with prior written permission from YouTube and, if applicable, the respective rights holders; or (c) as permitted by applicable law;

3. access the Service using any automated means (such as robots, botnets or scrapers) except: (a) in the case of public search engines, in accordance with YouTube’s robots.txt file; (b) with YouTube’s prior written permission; or (c) as permitted by applicable law;

9. use the Service to view or listen to Content other than for personal, non-commercial use (for example, you may not publicly screen videos or stream music from the Service)
slate swan
#

oh

#

sry

#

i didnt knew 2B_pat

mighty yarrow
vale wing
#

Do correct indents

#

What function is this code at

slate swan
#
  view = View()
  view.add_item(select)
  profile2.set_thumbnail(url=user.avatar.url)
  await interaction.response.send_message(embed=profile2, view=view, ephemeral=True)
    raise CommandInvokeError(self, e) from e
discord.app_commands.errors.CommandInvokeError: Command 'mine' raised an exception: HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In data.embeds.0.fields.0.name: This field is required
vale wing
tranquil badge
slate swan
#

i did

slate swan
#
  profile2.add_field(name='', value=f'**Pickaxe** {pick}\n{shovelrndm}\n{drillrndm}\n{fistrndm}')
  profile2.add_field(name='Multipliers', value=f'{moneymulti}\n{blockmulti}\n{xpmulti}\n{rubymulti}')
  profile2.set_author(name=f"{user.name}'s profile", icon_url=user.avatar.url)
vale wing
#

You only need to add cogs and sync the tree

slate swan
#

oh wait

tranquil badge
#

yea thats what i have but they arent being added

vale wing
tranquil badge
#

ive added it in

mighty yarrow
vale wing
mighty yarrow
#

oh ye i did

slate swan
#

Who uses client 💀

vale wing
#

This code is in a function. Please tell me the purpose of that function

#

Make them global from the beginning

#

Pycord has automatic sync and you can't do anything about it

split forge
#

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: '<' not supported between instances of 'str' and 'int'

vale wing
#

Without touching the protected members

split forge
#

This is the first time I encounter such an error.

tranquil badge
#
class SimpleCog(commands.Cog) -> None:
    def __init__(self, bot: commands.Bot):
        self.bot = bot

    @app_commands.command(name="source", description="GitHub repository link")
    async def source(self, interaction: discord.Interaction) -> None:
        src = "https://github.com/NinjaPanda263/Roc-Bot"
        await interaction.response.send_message(src)

async def setup(bot: commands.Bot) -> None:
    bot.add_cog(SimpleCog(bot))
    await bot.tree.sync()

this is what i have @vale wing

vale wing
vale wing
#

You do setup_hook wrong btw

mighty yarrow
#

@vale wing how to ignore this also

vale wing
#

Should be like this

class MyBot(commands.Bot):
    async def setup_hook(self):
        ...

bot = MyBot(...)
vale wing
vale wing
#

What you did

mighty yarrow
vale wing
#

Man

mighty yarrow
#

huh

vale wing
#

You don't need to create a separate listener for every damn exception

#

Just extend if-elif-else block

vale wing
#

Basic python smh

#

!e ```py
a = 69
if a == 10:
print("ten")
elif a > 10:
print("more")
else:
print("less")

unkempt canyonBOT
#

@vale wing :white_check_mark: Your 3.11 eval job has completed with return code 0.

more
mighty yarrow
vale wing
#

😳

slate swan
#

Does this look ok?

sacred oyster
#
import discord
from discord import app_commands


class aclient(discord.Client):

    def __init__(self):
        super().__init__(intents=discord.Intents.default())
        self.synced = False

    async def on_ready(self):
        await self.wait_until_ready()
        if not self.synced:
            await tree.sync(guild=discord.Object(id=990534020880277514))
            self.synced = True
        print(f"We have logged in as {self.user}")


client = aclient()
tree = app_commands.CommandTree(client)


@tree.command(name="hello",
              description="Hello user",
              guild=discord.Object(id=990534020880277514))
async def hello(interaction: discord.Interaction, name: str):
    await interaction.response.send_message(f"Hello {name}! I was made by me!")


client.run(
    'token')

the bot is online but i cant see the command

unkempt canyonBOT
#

examples/app_commands/basic.py lines 13 to 20

# A CommandTree is a special type that holds all the application command
# state required to make it work. This is a separate class because it
# allows all the extra state to be opt-in.
# Whenever you want to work with application commands, your tree is used
# to store and work with them.
# Note: When using commands.Bot instead of discord.Client, the bot will
# maintain its own tree instead.
self.tree = app_commands.CommandTree(self)```
slate swan
#

what should I use as intents?

main moth
#

How to fix this?

@client.listen()
async def on_message(message):
    if not message.guild:
        embed=discord.Embed(title="DM this Bot is not allowed!", url="", description="whoops this isn't in a server this is in dms", color=discord.Color.blue())
        await message.author.send(embed=embed)
        return

Error: ```
await message.author.send(embed=embed)
AttributeError: 'ClientUser' object has no attribute 'send'

slate swan
#

anyone know any servers where i can hire python devs

main moth
#

i mean the bot should send the person a dm who wrote. It just works but it comes also this error

naive briar
#

Make it ignore if the author is the bot

main moth
#

Okay thats simple. Thanks

main moth
slate swan
#
from discord.ext import commands
intents = discord.Intents(messages=True)
intents.members = True

client = commands.Bot(command_prefix='$', intents=intents)
TOKEN = 
@client.event
async def on_ready():
    print("We have logged in as {0.user}".format(client))

@client.event
async def on_message(message):
    if message.author == client.user:
        return

    if message.content.startswith("$hello"):
        await message.channel.send("Hello!")

client.run(TOKEN)```
doesn't show any error but zero response while sending $hello in a text channel
#

any idea how to fix that?

slate swan
# main moth discord.Intents.all()

discord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead.

Discord Developer Portal

Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.

slate swan
naive briar
#

!d discord.Intents.message_content

unkempt canyonBOT
#

Whether message content, attachments, embeds and components will be available in messages which do not meet the following criteria:

• The message was sent by the client

• The message was sent in direct messages

• The message mentions the client

This applies to the following events...

naive briar
#

And you have to enable the intents in the Dev portal also

slate swan
naive briar
#

Yes

slate swan
#

finally

#

it works

#

thanks, I love you

main moth
#

Can I dm a person where i have Discord Tag only as input?

#

For example a String with Flouu#8782

glad cradle
#

no

main moth
#

F

#

Is there any other way to DM a Person?

naive briar
#

IDs

main moth
#

Is there no way?

mighty yarrow
#

!d emoji

slate swan
slate swan
#

!f discord.ext.commands.UserConverter.convert

unkempt canyonBOT
#

You are not allowed to use that command here. Please use the #bot-commands channel instead.

slate swan
#

!d discord.ext.commands.UserConverter.convert

unkempt canyonBOT
#

await convert(ctx, argument)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

The method to override to do conversion logic.

If an error is found while converting, it is recommended to raise a [`CommandError`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.CommandError "discord.ext.commands.CommandError") derived exception as it will properly propagate to the error handlers.
slate swan
#

Any idea on how to make bot use commands of another bot?

#

Wdym

#

when I write /bump it triggers DISBOARD command but when bot writes it, nothing happens

#
    if message.content.startswith("!bump"):
        await message.channel.send("/bump")    

This is what I use

naive briar
#

Bots can't use slash commands

slate swan
#

oh

#

:(

mighty yarrow
#

whats the code for upload emoji

main moth
naive briar
unkempt canyonBOT
#

await create_custom_emoji(*, name, image, roles=..., reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Creates a custom [`Emoji`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Emoji "discord.Emoji") for the guild.

There is currently a limit of 50 static and animated emojis respectively per guild, unless the guild has the `MORE_EMOJI` feature which extends the limit to 200.

You must have [`manage_emojis`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions.manage_emojis "discord.Permissions.manage_emojis") to do this.
main moth
#

Other question: How to handle a missing argument. If arg == None: Does not work....

naive briar
#

Set default argument

main moth
#

Should i do it with try except?

main moth
naive briar
main moth
#

Could you send me an example

naive briar
#

About default arguments or error handler

main moth
#

Default is working fine for me, but if you think error handler is the better choice, pls send me example :=

#

🙂

naive briar
main moth
#

Default arguments working fine for me

#

Just thought to have a look at error handler

slate swan
#

what if someone changes their username?

main moth
slate swan
#

!d discord.Client.get_user

unkempt canyonBOT
#

get_user(id, /)```
Returns a user with the given ID.

Changed in version 2.0: `id` parameter is now positional-only.
loud junco
#

how do i pip install PIL

main moth
naive briar
#

!pypi Pillow

unkempt canyonBOT
main moth
loud junco
naive briar
#

What's the problem

loud junco
naive briar
loud junco
naive briar
loud junco
#

thaks

#
from PIL import Image
naive briar
#

You didn't install it

loud junco
#

pip istall PIL?

main moth
#

Could someone help me?

How to put in 2 Arguments with error handling, so that i can send a message if someone send for example 3 Args or 0

naive briar
#

There's package manager in replit

loud junco
#

thanks

loud junco
naive briar
#

Save from what

naive briar
#

What is a lik

loud junco
#

my n is ot workig ver well

#

gg keboard

main moth
loud junco
#

how do i even save photo on replit for PIL :/

naive briar
#

Make a request to the image link, then get the image data and put them in io.BytesIO, then use PIL.Image.open to open it

naive briar
#

!d io.BytesIO

unkempt canyonBOT
#

class io.BytesIO(initial_bytes=b'')```
A binary stream using an in-memory bytes buffer. It inherits [`BufferedIOBase`](https://docs.python.org/3/library/io.html#io.BufferedIOBase "io.BufferedIOBase"). The buffer is discarded when the [`close()`](https://docs.python.org/3/library/io.html#io.IOBase.close "io.IOBase.close") method is called.

The optional argument *initial\_bytes* is a [bytes-like object](https://docs.python.org/3/glossary.html#term-bytes-like-object) that contains initial data.

[`BytesIO`](https://docs.python.org/3/library/io.html#io.BytesIO "io.BytesIO") provides or overrides these methods in addition to those from [`BufferedIOBase`](https://docs.python.org/3/library/io.html#io.BufferedIOBase "io.BufferedIOBase") and [`IOBase`](https://docs.python.org/3/library/io.html#io.IOBase "io.IOBase"):
loud junco
#

do i need to import this

#

or is it installed by default

naive briar
#

Import it

loud junco
#

import io?

glad cradle
#

yes

loud junco
naive briar
#

Image bytes

loud junco
#

i tried googling it but i still dont understand ;-;

thorny raven
#

i need help

naive briar
loud junco
leaden hound
#

what is this?

loud junco
#

try removig "" for ("10403...")

naive briar
loud junco
#

so im not sure yes or no

loud junco
#

lemme try

slate swan
#

how do i make the bot activity be watching and then number of guilds the bot is in

loud junco
#

code

url = 'https://static.wikia.nocookie.net/monopoly/images/a/a5/Monopoly_Board_Game_%28UK%29.jpg/revision/latest/scale-to-width-down/1000?cb=20220120173735'
img = Image.open(urlopen(url))
await ctx.send(img)
#

looks legal? @naive briar

naive briar
#

What do you mean

loud junco
#

wait no
this is the output

slate swan
#

how do i make the bot activity be watching and then number of guilds the bot is in
??

slate swan
glad cradle
loud junco
glad cradle
slate swan
loud junco
loud junco
#

.send(embed=embed)

unkempt canyonBOT
naive briar
#

Get the len of that

slate swan
#

thankss!!!'

loud junco
#
url = 'https://static.wikia.nocookie.net/monopoly/images/a/a5/Monopoly_Board_Game_%28UK%29.jpg/revision/latest/scale-to-width-down/1000?cb=20220120173735'
img = Image.open(urlopen(url))
await ctx.send(file=img)
alpine cove
#

Ive never worked with translator but let me check the docs

loud junco
#

what kind of error is to_dict 💀

naive briar
#

Did you read what sarth said

loud junco
slate swan
#

not a pillow image, convert the image to a file obj first

loud junco
#

huh

#

i did .send(file=img)

alpine cove
#

bruh

loud junco
#

🥹

alpine cove
#

!d discord.File

unkempt canyonBOT
#

class discord.File(fp, filename=None, *, spoiler=..., description=None)```
A parameter object used for [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send") for sending file objects.

Note

File objects are single use and are not meant to be reused in multiple [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send")s.
naive briar
#

I have no words

loud junco
loud junco
alpine cove
#

instead of failing at maling. dc bot

loud junco
slate swan
#

maling

leaden hound
alpine cove
#

you prob did something like this:

#

member. discord.Member

#

int(member)

#

*:

slate swan
#

quite opposite

alpine cove
#

oh yea

leaden hound
alpine cove
#

he didnt put :discord.Member

#

lol

slate swan
#
def foo(ctx, time: int)

!foo @slate swan

leaden hound
#

I don't understand...

leaden hound
shrewd apex
#

(self, ctx,member... and so on

slate swan
#

@bot.event
async def on_ready():
    print(f"{bot.user.name} is online!")
    guilds = bot.guild.guilds
    await bot.change_presence(status=nextcord.Status.idle, activity=nextcord.Activity(type=nextcord.ActivityType.watching, name="{} guilds!".format(guilds)))```
#

AttributeError: 'Bot' object has no attribute 'guild'

naive briar
#

And it returns a list

#

You have to get the len of it

mighty yarrow
#

how to dm anyone without mutual server in discord.py?

#

is it possible

slate swan
#

no

cold frigate
#

does anyone know i can make my bot only copy the ids i send to it, but i only want it to do ids. this is how far ive come

cold frigate
# slate swan Wdym "copy"

i want to send a id in chat and for my bot to literally just copy it and send the id i sent into chat

slate swan
honest shoal
slate swan
honest shoal
slate swan
#

how do i connect them

slate swan
naive briar
#

Connect what

slate swan
#

so the colour would be the color they provide

#

and the staffrole either

slate swan
#

hex code

#

but either the staff role

#
    if colour:
        embed.colour(teal = 0x1abc9c,
    dark_teal = 0x11806a,
    green = 0x2ecc71,
    dark_green = 0x1f8b4c,
    blue = 0x3498db,
    dark_blue = 0x206694,
    purple = 0x9b59b6,
    dark_purple = 0x71368a,
    magenta = 0xe91e63,
    dark_magenta = 0xad1457,
    gold = 0xf1c40f,
    dark_gold = 0xc27c0e,
    orange = 0xe67e22,
    dark_orange = 0xa84300,
    red = 0xe74c3c,
    dark_red = 0x992d22,
    lighter_grey = 0x95a5a6,
    dark_grey = 0x607d8b,
    light_grey = 0x979c9f,
    darker_grey = 0x546e7a,
    blurple = 0x7289da,
    greyple = 0x99aab5)```

```Ignoring exception in command <nextcord.application_command.SlashApplicationCommand object at 0x00000199C76033A0>:
Traceback (most recent call last):
  File "C:\Users\PC\AppData\Roaming\Python\Python39\site-packages\nextcord\application_command.py", line 863, in invoke_callback_with_hooks
    await self(interaction, *args, **kwargs)
  File "c:\Users\PC\Desktop\Appelsy Bot\main.py", line 78, in embed_create
    embed.colour(teal = 0x1abc9c,
TypeError: 'NoneType' object is not callable

The above exception was the direct cause of the following exception:
naive briar
#

colour is a property

#

You can't call it

slate swan
#

its an embed creator

naive briar
#

The error is saying otherwise

#

And what are you even trying to do

slate swan
cold frigate
mighty yarrow
#

@client.command(pass_context=True)
async def unbanall(ctx):
guild=ctx.message.guild
ban_list=await client.get_bans(guild)
await client.say('Unbanning {} members'.format(len(ban_list)))
for member in ban_list:
await client.unban(guild,member)

coarse yew
mighty yarrow
#

raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Bot' object has no attribute 'get_bans'

coarse yew
torn sail
#

And same for discord.ui.View

dense merlin
#

Issue With Logging issues :/. The Issue is supposed to go into a log file, but nope , it doesnt.
Code:

@bot.command()
async def reportIssue(ctx,Issue:str):
logging.info((str(ctx.message.author.id)+Issue))
await ctx.reply('Issue Logged!')

cold frigate
mighty pilot
#

Nvm I'm dumb. Haven't worked with select menus enough

cold frigate
#

same super new to it first time trying them out

mighty pilot
#

You want self.add_item(StartOfTicket())

cold frigate
#

have no idea what im doing but happy to learn

mighty pilot
cold frigate
#

@mighty pilot

mighty pilot
#

At the very bottom where the light bulb is

#

You want self.add_item(StartOfTicket())

#

Instead of add_view

cold frigate
#

thanks it works now

mighty pilot
weary epoch
mighty pilot
#

Reddit has some pages where people can post about bot requests

potent dock
slate swan
#

They kinda just 'clicked' for me at some point, now the majority of my current project's code is inside buttons instead of the actual commands.

#
  if shovel != 0:
    shovelrndm = random.randint(1, 100)
  if rubychance >= 1 and rubychance <= 30:
    rubyrndm = random.randint(1, 10)
    if rubymulti == 0:
      rubymulti == 1
  rubyrndm = rubyrndm * rubymulti
  await interaction.response.send_message(f"ruby rndm {rubyrndm}\nruby chance {rubychance}\nshovel random {shovelrndm}")
#
Traceback (most recent call last):
  File "/home/runner/miner-bot/venv/lib/python3.8/site-packages/discord/app_commands/commands.py", line 862, in _do_call
    return await self._callback(interaction, **params)  # type: ignore
  File "main.py", line 442, in mine
    rubyrndm = rubyrndm * rubymulti
UnboundLocalError: local variable 'rubyrndm' referenced before assignment

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/runner/miner-bot/venv/lib/python3.8/site-packages/discord/app_commands/tree.py", line 1242, in _call
    await command._invoke_with_namespace(interaction, namespace)
  File "/home/runner/miner-bot/venv/lib/python3.8/site-packages/discord/app_commands/commands.py", line 887, in _invoke_with_namespace
    return await self._do_call(interaction, transformed_values)
  File "/home/runner/miner-bot/venv/lib/python3.8/site-packages/discord/app_commands/commands.py", line 880, in _do_call
    raise CommandInvokeError(self, e) from e
discord.app_commands.errors.CommandInvokeError: Command 'mine' raised an exception: UnboundLocalError: local variable 'rubyrndm' referenced before assignment
#

someone please tell me why its saying this

naive briar
#

If this if statement isn't true

#

The variable won't exist

mighty pilot
#

Try moving the rubyrndm = rubyrndm * rubymulti in line with your rubymulti == 1

#

Or add in an else: statement to match your if

#

To give it different values if they don't qualify for your if

cold frigate
#

why wont my dropdown send a embed when i click it

faint mural
#

You should be using interaction for example you can edit the original message with another view

mighty pilot
faint mural
#

Oh this is not an Select subclass?

mighty pilot
#

The top is a select class then the view that adds it below

faint mural
#

If it was then you can just use self.values and not pass it to callback (unsure if that even works)

cold sonnet
#

sometimes I still look into this channel and see

cold sonnet
slate swan
cold sonnet
#

same

cold frigate
#

this is my dropdown

cold sonnet
#

yeah get the callback out there

#

in the class but not in the __init__

#

it's also self.values

#

not select

#

!d discord.ui.Select.callback idk anymore what this is passed

#

!d discord.ui.Select.callback

unkempt canyonBOT
#

await callback(interaction)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

The callback associated with this UI item.

This can be overridden by subclasses.
cold sonnet
#

remove select from the args completely

cold sonnet
#

nice

cold frigate
#

uh okay ill try ig

cold sonnet
naive briar
mighty pilot
#

Hey while there's people here that know more than me, I'm having a problem editing a message my bot sends. It's a level bot so a user sends a message in a channel, then in the bot spam channel it sends a message with a button view. I'm trying to disable the buttons after the view times out and can't figure out how to do that from inside the view since the event isn't an interaction it's just a message that the bot sends in a channel

#

One sec I'll send what I have

#

I have the on_timeout made I just don't know how to grab the message object that's sent inside the on_message

cold sonnet
#

oh okay, well send code

mighty pilot
#

Pc updating and turning on sadgeng

#

heres the timeout that doesnt currently work

slate swan
#

ModuleNotFoundError: No module named 'discord'
How do i fix this error?

mighty pilot
#

heres where the message is sent from inside the on_message

cold frigate
#

in cmd

mighty pilot
cold frigate
#

@mighty pilot also im like

#

super confused on what To change

#

😭

slate swan
# cold frigate pip install discord

I also did that but then I get this error no matter what. I also made sure to have the latest versions of pip.
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for yarl
Failed to build multidict yarl
ERROR: Could not build wheels for multidict, yarl, which is required to install pyproject.toml-based projects

slate swan
#

I do

cold frigate
#

oh

naive briar
#

Move it down

cold frigate
#

ah

slate swan
#

its not reading the clr

mighty pilot
cold frigate
#

@naive briar ? like this right

slate swan
fading marlin
sick birch
mighty pilot
naive briar
slate swan
fading marlin
mighty pilot
naive briar
#

🥹

slate swan
#

oh got it

#

i dont need the print right?

naive briar
#

!e

colours = dict(black="0x000000", white="0xffffff")

print(colours.get("black"))
print(colours.get("red", "default_colour"))
unkempt canyonBOT
#

@naive briar :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | 0x000000
002 | default_colour
cold frigate
slate swan
#

what's the point of storing hex as a string