#discord-bots

1 messages · Page 753 of 1

slate swan
#

r = the annual interest rate

#

ah shit, someone wants my help somewhere else

subtle frigate
#

yeah I figured that but how to calculate if the situation is compounded half yearly/quaterly

subtle frigate
maiden fable
native wedge
#

Hello I am trying to pass a kick command, sadly my error handler does not help, does anyone know the solution?

from discord.ext import commands
import os
import discord
import time
from datetime import datetime
import random



class Moderation(commands.Cog):
  
  def __init__(self, bot: commands.Bot):
        self.bot = bot
        self.last_mng = None


  @commands.command(name="kick")
  @commands.has_guild_permissions(kick_members=True)
  async def kick(ctx, member : discord.Member, *, reason = None):
    await member.kick(reason=reason)


def setup(bot: commands.Bot):
    bot.add_cog(Moderation(bot))```
subtle frigate
maiden fable
#
time = time*4
rate = rate/4
#

same with half yearly, just divide, multiply by 2

subtle frigate
#

gotcha thanks!

slate swan
maiden fable
#

Uhhhhh?

native wedge
maiden fable
#

Okay...

slate swan
#

i believe this problem is a skill issue.

maiden fable
#

show yr error handler

native wedge
# maiden fable show yr error handler
from discord.ext import commands # Again, we need this imported
import os
import discord
import time
from datetime import datetime


class ErrorHandler(commands.Cog):

    def __init__(self, bot: commands.Bot):
        self.bot = bot
        self.last_mng = None


    @commands.Cog.listener()
    async def on_command_error(self, ctx: commands.Context, error:commands.CommandError):            
        """A global error handler cog."""

        if isinstance(error, commands.CommandNotFound):
            return  
        elif isinstance(error, commands.CommandOnCooldown):
            message = f"This command is on cooldown. Please try again after {round(error.retry_after, 1)} seconds."
        elif isinstance(error, commands.MissingPermissions):
            message = "You are missing the required permissions to run this command!"
        elif isinstance(error, commands.UserInputError):
            message = "Something about your input was wrong, please check your input and try again!"
        else:
            message = "Oh no! Something went wrong while running the command!"

        await ctx.send(message, delete_after=5)
        await ctx.message.delete(delay=5)





def setup(bot: commands.Bot):
    bot.add_cog(ErrorHandler(bot))```
maiden fable
#

ah I got the issue

#

in the else statement, add another line raise error

#

at the end ^^^

native wedge
#
else:
raise error```
#

?

maiden fable
#

after these 2 lines

#

raise error

#

and then restart yr bot

native wedge
#

alright it gives me this

maiden fable
#

there

#

ah

#

u r forgetting the self arg

#

u r in a class, forgot?

native wedge
maiden fable
#

so its taking ctx as self and member as ctx

native wedge
#

like that?

maiden fable
#

mhm

native wedge
#

alright it worked, im still learning classes

#

ty

#

how do i add colors to embeds?

maiden fable
#

!d discord.Embed.colour

unkempt canyonBOT
#

The colour code of the embed. Aliased to color as well. This can be set during initialisation.

maiden fable
#

smh Python

winged crane
#

e = discord.Embed(colour=discord.Colour.green())

winged crane
maiden fable
#

???

winged crane
#

You can change green to whatever color

twin moon
#

how do I delete a message after a timeout in nextcord

maiden fable
#

smh dude

#

!d discord.ui.View.on_timeout

unkempt canyonBOT
#

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

A callback that is called when a view’s timeout elapses without being explicitly stopped.
wild ivy
maiden fable
#

Lmao

wild ivy
maiden fable
#

its on github?

#

It all depends on the license

quick gust
#

I don't think so

twin moon
#

Lmao idk

wild ivy
#

pp

pliant gulch
wild ivy
#

Yo ngl...python is da best

#

🤝

#

shatap

#

nub

maiden fable
#

can we stop the emoji spam

wild ivy
#

yes

wild ivy
#

y e s

maiden fable
lament depotBOT
#
**What unique features does your bot contain, if any?**

Suggest more topics here!

maiden fable
#

Thanks

wild ivy
#

My vsc isnt working well

#

:c

#

I like the app but I cnt code on it

twin moon
twin moon
pliant gulch
#

That's called a no license

#

That does not mean it's free to take

#

In the case of a no license it is not permissive at all

#

Thus you cannot copy, redistribute, etc

twin moon
maiden fable
#

Time to make all my repos non licensed then

pliant gulch
#
slate swan
#

license up my boys

maiden fable
#

Thought non licensed meant anyone can copy

pliant gulch
#

A lot of people do

#

but it isn't kek

slate swan
#

erm..

#

that actually means

#

everyone can copy your code

#

also you need to include the MIT license file into the projects root folder

#

there's no such thing

#

if you don't want people copying your code you make it closed-source

slim ibex
#

Most if not all of the licenses provided on GitHub allow people to use it for their own private use

slate swan
#

mee6 isn't open source though..

slim ibex
#

Most of those big bots aren’t open source

pliant gulch
#

No license

#

Not as in no license at all exists, "no license"

#

Or any license that has terms of no copying

#

MIT is permissive so def not something you want if you don't want copiers!

#

Without the owners consent

slate swan
#

the later

pliant gulch
#

Called "no license" and you don't give a license either

#

People call it no license

#

No just don't have a license

#

I mean, but it's also good to specify you are doing No license

#

Otherwise people will think it's an oversight

slate swan
#

if you don't intend on sharing your code though

#

why open source?

slim ibex
#

^

pliant gulch
#

Transparency

slim ibex
#

that has nothing to do with licenses

pliant gulch
#

I'd much rather have microsofts source code and not be able to copy anything

#

If I was able to see all the telemetry stuff they do!

slate swan
#

well most certainly that is a very specific case

pliant gulch
#

Not really

slate swan
#

my guy isn't about to create windows 12

pliant gulch
#

Can you 100% trust any company without seeing the internals?

slim ibex
slate swan
#

hellow. ihave this code. ```python
@nextcord.ui.button(label=f"✅", style=nextcord.ButtonStyle.gray)
async def Question1(self, button: nextcord.ui.Button, interaction: nextcord.Interaction):
test = 0
test += 1
user = interaction.user
emb=nextcord.Embed(title="✅ Approved Suggestion", description=f"Ευχαριστούμε για την γνώμη σου!{test}", color=0x00FF00, timestamp=datetime.now())
emb.set_author(name=user.name, icon_url=user.avatar.url)
await interaction.response.send_message(embed=emb, ephemeral=True)

but it doenst update tha test and it keeps saying 1 no matter how many times i press the button
#

could put it in the readme file

#

could put it in the description

#

in the code with __license__

pliant gulch
#

Just somewhere in the codebase announce that the project is no license

#

You don't need license at all

slim ibex
#

why? If the project is not open source and only for you

pliant gulch
#

But you have no license

slim ibex
#

you don’t need a license unless you need to have the rights to it and specify what people can do with it

pliant gulch
#

No, just don't use __license__

slim ibex
#

if the code is currently only you using it and it’s not public, a license won’t help anything

pliant gulch
#

but you are doing NO license

#

Just announce somewhere in the code base you are going No license so people know it isn't an oversight

slim ibex
#

IE. read me

slate swan
pliant gulch
#

you choose ¯_(ツ)_/¯

maiden fable
#

so that people don't think of u as a beginner because of not having a license

maiden fable
#

cz everytime a button is clicked, u r setting test to 0 and then adding 1

#

think about it yourself... first 0, then 1, then 0

wild ivy
slate swan
#

i made it like that```python
test = 0

class sugbut(nextcord.ui.View):
def init(self):
super().init()
self.view = None

@nextcord.ui.button(label=f"✅", style=nextcord.ButtonStyle.gray)
async def Question1(self, button: nextcord.ui.Button, interaction: nextcord.Interaction):
test += 1
user = interaction.user
emb=nextcord.Embed(title="✅ Approved Suggestion", description=f"Ευχαριστούμε για την γνώμη σου!\n Total Votes: {test}", color=0x00FF00, timestamp=datetime.now())
emb.set_author(name=user.name, icon_url=user.avatar.url)
await interaction.response.send_message(embed=emb, ephemeral=True)

but it gibes this error
maiden fable
#

yea

wild ivy
#

Hmm,

#

y'all r smort

maiden fable
#

u can instead make a class variable in the init

wild ivy
#

😔

maiden fable
#

self.test = 0

#

and then increment that

maiden fable
wild ivy
#

i cnt even finish my discord bot lmao

maiden fable
#

Its fine, same with me

#

even tho its already in 109 servers

wild ivy
#

..

#

😭

maiden fable
wild ivy
#

:

maiden fable
#

what

wild ivy
slate swan
#

now with this, gives this erroe ```python
class sugbut(nextcord.ui.View):
def init(self):
super().init()
self.view = None
self.test = 0

@nextcord.ui.button(label=f"✅", style=nextcord.ButtonStyle.gray)
async def Question1(self, button: nextcord.ui.Button, interaction: nextcord.Interaction):
self.test += 1
user = interaction.user
emb=nextcord.Embed(title="✅ Approved Suggestion", description=f"Ευχαριστούμε για την γνώμη σου!\n Total Votes: {test}", color=0x00FF00, timestamp=datetime.now())
emb.set_author(name=user.name, icon_url=user.avatar.url)
await interaction.response.send_message(embed=emb, ephemeral=True)

`NameError: name 'test' is not defined`
wild ivy
maiden fable
#

u still have it named as test

slate swan
#

thanks guys xD

wild ivy
maiden fable
#

what

wild ivy
#

How to code like a hooman

maiden fable
#

Idk

wild ivy
maiden fable
#

Lol

covert otter
#
 @commands.Cog.listener()
    async def on_message(self, message):
        messageAuthor = message.author

        if bannedWords != None and (isinstance(message.channel, discord.channel.DMChannel) == False):
            for bannedWord in bannedWords:
                if msg_contains_word(message.content.lower(), bannedWord):
                    await message.delete()
                    await message.channel.send(f"{messageAuthor.mention} tu mensaje sera revisado por un mod")

        await self.client.process_commands(message)```


`Ignoring exception in on_message
Traceback (most recent call last):
  File "C:\Users\MiPC\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "C:\Users\MiPC\Desktop\BD\cogs\CogC\deleter.py", line 37, in on_message
    await message.delete()
  File "C:\Users\MiPC\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\message.py", line 1023, in delete
    await self._state.http.delete_message(self.channel.id, self.id)
  File "C:\Users\MiPC\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\http.py", line 250, in request
    raise NotFound(r, data)
discord.errors.NotFound: 404 Not Found (error code: 10008): Unknown Message`

I have no idea how to fix it xD
slate swan
#

hi lol

maiden fable
slate swan
#
Ignoring exception in on_message
Traceback (most recent call last):
  File "C:\Users\grace\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "c:\Users\grace\Desktop\CyberWare dependency\main.py", line 17, in on_message
    await user.send("it works.")
AttributeError: 'NoneType' object has no attribute 'send'```

```py
@bot.event
async def on_message(msg):
    if msg.webhook_id:
        print(msg.content)
        new_str = str(msg.content).lstrip("<@").rstrip(">")
        user = bot.get_user(int(new_str))
        await user.send("it works.")```
maiden fable
#

!d discord.Message.mentions

slim ibex
#

the user object is none

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.

maiden fable
#

Use this (:

vague grove
#

how do you get avatar url in disnake, its different from discord.py for some reason

slate swan
#

ok so how do i get the thing after the command ex; $command thing after the command

#

then ill remove the spaces and replace it with +

#

its gonna do

#

$google i am dog

untold token
#

not avatar_url

slate swan
#

PLS PING ME

#

@slate swan

full lily
#

!code

unkempt canyonBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

slate swan
#

alright

#
@bot.command()
async def google(ctx, word):
    await ctx.send('https://www.google.com/search?q={}'.format(word))
devout iris
#

hey how to check messages from an user?
like "if discord.Member_id == "id":
...

full lily
#

what you have only works for one word

#
async def google(ctx, *, word):
#

This should work for you

full lily
slate swan
#

how do i replace the spaces with +

full lily
#

!d str.replace

unkempt canyonBOT
#

str.replace(old, new[, count])```
Return a copy of the string with all occurrences of substring *old* replaced by *new*. If the optional argument *count* is given, only the first *count* occurrences are replaced.
slate swan
#
 str.word.replace(" ", "+")
#

can i do this

devout iris
#

as channel id

full lily
#

?

full lily
#

word is a string

slate swan
#

oh

#

im pretty fresh in python

#

new

#
@bot.command()
async def google(ctx, *, word):
    str.replace(" ", "+")
    await ctx.send('https://www.google.com/search?q={}'.format(word))
#

@full lily doesnt work

full lily
slate swan
#

yes

#

i removed

#

word

full lily
#

you removed word

slate swan
#

yes

#

did i have to replace it with str?

full lily
slate swan
#

oh

full lily
#

hee hee

slate swan
#

bro sorry

full lily
#

your word is a string

#

it is of the type string

#

so you can use string methods on it

#

str.replace is a string method

slate swan
#

i was confused why you told me to remove word

#

now it makes sense

cloud dawn
#

!f-strings :3

unkempt canyonBOT
#

Creating a Python string with your variables using the + operator can be difficult to write and read. F-strings (format-strings) make it easy to insert values into a string. If you put an f in front of the first quote, you can then put Python expressions between curly braces in the string.

>>> snake = "pythons"
>>> number = 21
>>> f"There are {number * 2} {snake} on the plane."
"There are 42 pythons on the plane."

Note that even when you include an expression that isn't a string, like number * 2, Python will convert it to a string for you.

slate swan
#

oh

#

so like this

#

thats way easier

cloud dawn
slate swan
#

life lesson

#
@bot.command()
async def google(ctx, *, word):
    word.replace(" ", "+")
    await ctx.send(f'https://www.google.com/search?q={word}')
#

not working

cloud dawn
#

What did you type in?

slate swan
#

ok

#

basically $google i am dog

#

now you replace the " " with "+"

#

which does i+am+dog

#

@cloud dawn

cloud dawn
#

What did it return?

#

Need more info sorry

slate swan
#

alright

#

@cloud dawn

magic ore
#

str.replace doesn't modify the original string

#

it returns the modified string

cloud dawn
#

indeed

cloud dawn
#

This should work

slate swan
#

i was thinking about that

#

alright ill check

#

ok all this time for a stupid command nobody will ever use

#

whatever i learned a lot

rugged tangle
#

can someone help me? i'm getting the "unident does not match any outer indentation level" error on this:

if message.content.startswith("!del"):
encouragements = []
if "encouragements" in db.keys():
index = int(message.content.split("!del",1)[1])
delete_encouragments(index)
encouragements = db["encouragements"]
await message.channel.send(encouragements) <-(it's here)

cold sonnet
#

I think you missed a space

#

-_-

rugged tangle
#

where?

cold sonnet
#

send a screenshot of it

rugged tangle
#

alright

cold sonnet
rugged tangle
#

so

cold sonnet
#

it's at the end

#

why

#

how does the code continue

#

you're making me look dumb

vague grove
#

how can i make a slash command user view only (disnake)

rugged tangle
#

wait

#

ends with a token

#

so, what do I do?

vague grove
#

what the point of my_secret?

rugged tangle
#

in order to keep my bot's private token secret

cold sonnet
#

huh

rugged tangle
#

I'm making a discord bot

cold sonnet
#

oh

vague grove
#

cus its useless the way you have it

#

since client.run is already grabbing it

rugged tangle
#

okay, but will it fix my problem?

vague grove
rugged tangle
vague grove
cold sonnet
#

might be an IDE glitch

rugged tangle
#

how do I fix it?

cold sonnet
#

restart IDE

rugged tangle
#

okay

#

didn't work

dire folio
#

I think he's using replit

final iron
rugged tangle
final iron
#

The indentation looks fine

dire folio
#

Idk what to add to my bot

final iron
#

What do you have so far?

rugged tangle
#

that's the maximum I could take in a screenshot

slate swan
#
@bot.command()
async def help(ctx):
    embed = discord.Embed(title="Hello, world!", description=":D", colour=0x87CEEB)
    embed.set_author(name="vcokltfre", icon_url="https://avatars.githubusercontent.com/u/16879430")
    embed.add_field(name="Field 1", value="Not an inline field!", inline=False)
    embed.add_field(name="Field 2", value="An inline field!", inline=True)
    embed.add_field(name="Field 3", value="Look I'm inline with field 2!", inline=True)
#

not working, embeds not working

dire folio
#

I want to make a level system but cause I use replit to host it goes offline a lot so it's impractical

final iron
slate swan
#

expected output:

slate swan
#

ok maybe

rough wadi
slate swan
#

If you never send it, no wonder it will never be shown.

dire folio
rugged tangle
final iron
slate swan
#

still 322025

dire folio
kind wind
#

I try to do a command that DMs you every time you send it but it worked once. then it stopped working

slate swan
#

wdym

rugged tangle
# dire folio Can u copy paste

options = starter_encouragements
if "encouragements" in db.keys():
options = options + db["encouragements"]

 if any(word in message.content for word in sad_words):
   await message.channel.send(random.choice(options))

if message.content.startswith("!new"):
encouraging_message = message.content.split("!new ",1)[1]
update_encouragements(encouraging_message)
await message.channel.send("New encouraging message added.")

if message.content.startswith("!del"):
encouragements = []
if "encouragements" in db.keys():
index = int(message.content.split("!del",1)[1])
delete_encouragments(index)
encouragements = db["encouragements"]
await message.channel.send(encouragements)

my_secret = os.environ['TOKEN']

client.run(os.getenv('TOKEN'))

unkempt canyonBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

slate swan
#

this is the help command?

kind wind
slate swan
#

You need to remove the old one.

final iron
vague grove
#

is there a way to make slash commands user only on disnake

rough wadi
slate swan
#

help_command=None when you initialize the bot object.

slate swan
dire folio
slate swan
#

what reallt

kind wind
slate swan
cold sonnet
#

await message.channel.send(encouragements)
is missing 2 spaces at the start

kind wind
# dire folio Send code
@bot.command()
@mods_or_owner()
async def proexpire(ctx, member : discord.Member = None):
  if member is not None:
    channel = member.dm_channel
    if channel is None:
      channel = await member.create_dm()
    await channel.send("You have a pro membership that will expire soon! To enable the pro membership use `v!pro`")
  else:
    await ctx.send("Please mention the user you want to notify!")

@bot.command()
async def pro(ctx, member : discord.Member = None):
  if member is not None:
    channel = member.dm_channel
    if id == "674960649662627850" or "608575327811272704":
      if channel is None:
        channel = await member.create_dm()
      else:
        await channel.send("You have activated your pro membership!")
        prorole = ctx.guild.get_role(911248795382194201)
        await ctx.author.add_roles(prorole)
    else:
      await ctx.send("You have no pro packages to activate!\nYou can buy pro packages at our website, or win them by a giveaway.")
rough wadi
dire folio
#

What is @mods_or_owner()

kind wind
#

it doesnt bother the code

slate swan
#

gg bois

dire folio
rough wadi
slate swan
#

yes

rough wadi
#

🙂

slate swan
#

bro ur so good

rough wadi
#

It’s all good

rough wadi
#

There is already a help command built in so you always have to remove it

slate swan
#

yesyes

dire folio
#

It should still send in dms iirc

dire folio
rugged tangle
#

so what do I do?

kind wind
#

so i remove the

if channel is None:
  channel = await member.create_dm()

?

dire folio
#

Ye and instead of channel.send do member.send

rough wadi
cold sonnet
#

ctx.author

rough wadi
#

Or that

kind wind
#

this

dire folio
#

Ye remove the channel = member.dm_channel part

kind wind
#

lemme try it now

#
Ignoring exception in command pro:
Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "c:\Users\user\Desktop\Vaggelis\Coding\Bots\VDP's Utilities\main.py", line 105, in pro
    await member.send("You have activated your pro membership!")
AttributeError: 'NoneType' object has no attribute 'send'

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

Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'send'```
Error
#

the second command has problem

dire folio
#

Is the first one fine?

kind wind
#

yeah

dire folio
#

Can u send code for just second one

slim ibex
#

The member instance is none which is why it’s raising the error

kind wind
#
@bot.command()
async def pro(ctx, member : discord.Member = None):
  if id == "674960649662627850" or "608575327811272704":
      await member.send("You have activated your pro membership!")
      prorole = ctx.guild.get_role(911248795382194201)
      await ctx.author.add_roles(prorole)
  else:
    await ctx.send("You have no pro packages to activate!\nYou can buy pro packages at our website, or win them by a giveaway.")
dire folio
#

What's id?

kind wind
#

the userid

dire folio
slim ibex
#

that’s probably why the error is raising

dire folio
#

^

magic ore
#

!or

unkempt canyonBOT
#

When checking if something is equal to one thing or another, you might think that this is possible:

if favorite_fruit == 'grapefruit' or 'lemon':
    print("That's a weird favorite fruit to have.")

While this makes sense in English, it may not behave the way you would expect. In Python, you should have complete instructions on both sides of the logical operator.

So, if you want to check if something is equal to one thing or another, there are two common ways:

# Like this...
if favorite_fruit == 'grapefruit' or favorite_fruit == 'lemon':
    print("That's a weird favorite fruit to have.")

# ...or like this.
if favorite_fruit in ('grapefruit', 'lemon'):
    print("That's a weird favorite fruit to have.")
vague grove
#

so for disnake to remove the help command its help_command=None but when i run my own help command the default one still pops up :/

slim ibex
#

and you know that or returns the first truthy value

magic ore
#

ids are also ints not strings

slim ibex
#

It doesn’t work how you think it does

slim ibex
kind wind
dire folio
#

Did you make the IDs ints?

slim ibex
#

!or

kind wind
#

and also got error

kind wind
slim ibex
#

you can set a local variable

dire folio
#

They should be ints so remove the "

slim ibex
#

users = [id, id]

#

and do if member in users

dire folio
slim ibex
#

^

#

lmao

kind wind
#

i tried something

#

lemme see if it works

dire folio
kind wind
#

Okay it sends the message but not in dm

#

It works just fine with no error

vague grove
dire folio
dire folio
kind wind
vague grove
#

weird since mines named help and the bloody thing still sends mine

dire folio
kind wind
#

Also I noticed something. I also put my id in the example that binds send before
users = [id, id]
but it used the else

kind wind
dire folio
#

What's ur if statement

dire folio
kind wind
#
@bot.command()
async def pro(ctx, member : discord.Member = None):
  prousers = [674960649662627850, 608575327811272704]
  if member in prousers:
      await member.send("You have activated your pro membership!")
      prorole = ctx.guild.get_role(911248795382194201)
      await ctx.author.add_roles(prorole)
  else:
    await ctx.send("You have no pro packages to activate!\nYou can buy pro packages at our website, or win them by a giveaway.")
dire folio
kind wind
#

i tried

#

and got error

dire folio
#

What error?

kind wind
#

wait

#
Ignoring exception in command pro:
Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "c:\Users\user\Desktop\Vaggelis\Coding\Bots\VDP's Utilities\main.py", line 105, in pro
    if member.id in prousers:
AttributeError: 'NoneType' object has no attribute 'id'

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

Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'id'
dire folio
#

That means member is None

wild ivy
#

pp

kind wind
slate swan
#

alright

dire folio
opaque vessel
dire folio
opaque vessel
#

cant find the one

slate swan
#

not discord bots

#

thaats the last channel

#

you should try

kind wind
#

its free rn

dire folio
#

colour should not be equal to a list

slate swan
#

well i want a random colour

#

OJHJ

#

IM SO DUMB

dire folio
#

That's is not how you go about doing that

slate swan
#

OK SORRY BYE

dire folio
#

Also it doesn't do colours like that

kind wind
slate swan
#

i can do this

#

ok nevermind

#

i look even dumber

slate swan
#

also

#

y isnt it working

#

OH

#

I GOT THE FORMAT WRONG OMG SO SORRY

dire folio
# kind wind changes?
@client.command()
async def pro(ctx, member: discord.Member = None):
    prousers = [485442448244342786, 608575327811272704]
    if member.id in prousers:
        await member.send("You have activated your pro membership!")
        prorole = get(ctx.guild.roles, id=911248795382194201)
        await member.add_roles(prorole)
    else:
        await member.send("You have no pro packages to activate!\nYou can buy pro packages at our website, or win them by a giveaway.")
slate swan
#

ok why isnt it working

#
hexcode = ['FA291A','FA701A','FAD11A','7BFA1A','1AB7FA','831AFA','FA1AFA']

@bot.command()
async def help(ctx):
    embed = discord.Embed(title="Help command", description="Lists of commands", colour=random.choice(hexcode))
distant tree
#

does anyone know anything about a good vps for a discord bot under 5$? (less preferably) I'm looking and vultr and galaxygate. i'm really looking for a fast response time from my bot and the lowest ping possible.

slate swan
#

the example

dire folio
#

make sure you have from discord.utils import get @kind wind

slate swan
#

"embed = discord.Embed(title="Hello, world!", description=":D", colour=0x87CEEB)"

#

thats their code

#

ok mine is randomizee

slate swan
#

like a thing thatll make ur bot

#

active 24/7

distant tree
slate swan
#

alright i got a web free

#

uptimerobot

distant tree
#

i've tried it, not much of a fan

slate swan
#

ok

#

next heroku

#

thats cool

distant tree
#

heroku has a roughly 7-day downtime at the end of each month

slate swan
#

alr wait

#

on another server theres a list

#

wait im banned

distant tree
slate swan
#

yeah

#

ask for the command to see them all

dire folio
slate swan
#

ok

#

its been a sec

dire folio
#

replit is being bad

#

u'll have to give me like 5mins

slate swan
#

ok

#

il give u a fiverr

final iron
#

hm?

#

Why are you giving him a fiverr?

slate swan
#

ok a fiverr means

#

five

dire folio
#

ngl i would like a fiver

slate swan
#

like a five dollar bill

#

but in this case scenario thing

#

itmeans 5 mins

dire folio
#

@final iron is what max is asking possible

#

cause i don't think it is

final iron
#

Whats he asking

dire folio
#

he wants a randomised colour for his embed using a list

slate swan
#

It is possible

final iron
#

What is it?

slate swan
#

Or just use discord.Colour.random()

dire folio
#

i think he wants to use those specific colours

dire folio
slate swan
final iron
#

Oh

slate swan
#

Then you can use random.choice on the list.

final iron
#

!d random.shuffle

slate swan
#

okokokokokokokok

unkempt canyonBOT
#

random.shuffle(x[, random])```
Shuffle the sequence *x* in place.

The optional argument *random* is a 0-argument function returning a random float in [0.0, 1.0); by default, this is the function [`random()`](https://docs.python.org/3/library/random.html#random.random "random.random").

To shuffle an immutable sequence and return a new shuffled list, use `sample(x, k=len(x))` instead.

Note that even for small `len(x)`, the total number of permutations of *x* can quickly grow larger than the period of most random number generators. This implies that most permutations of a long sequence can never be generated. For example, a sequence of length 2080 is the largest that can fit within the period of the Mersenne Twister random number generator.

Deprecated since version 3.9, will be removed in version 3.11: The optional parameter *random*.
final iron
#

Or random.choice

slate swan
#

ok letme try

dire folio
slate swan
#

Just like anything else?

#

!e
import random

l = [0xFFFFFF, 0xFF00FF, 0x00FF00]

print(random.choice(l))

unkempt canyonBOT
#

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

16777215
slate swan
#

It's basically the decimal value.

#

wait like ths

#

No, not as strings as I said.

#

Remove the ''.

#

kk

#

didnt know u were allowed

slate swan
#

You could write the decimal value of each color instead of 0x..., it's just not convenient.

dire folio
#

i never knew this

slate swan
#

okk done

#

works

#

alr thanks humans

cloud dawn
slate swan
#

ikr

rugged steeple
# slate swan ok mine is randomizee

Yours contains strings, not hex numbers. Thats the issue.

You're trying to set color to "00101F" for example, which is invalid.
It expects color to be set to 0x00101F

rugged steeple
cloud dawn
#

@slate swan Please behave yourself.

slate swan
dire folio
#

what u are asking for sounds like it would be against a ToS

cloud dawn
#

No you are not, look at the chat, please keep it civil and stop asking for us to make a spam bot or offer money.

wicked atlas
#

!rule 5

unkempt canyonBOT
#

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

cloud dawn
#

<@&831776746206265384>

visual yarrow
#

@slate swan This is not something you may ask for help with in this server.

slate swan
#

kk

final iron
#

What happened here

slate swan
#

idk

cloud dawn
final iron
#

I see that

cloud dawn
#

@final iron What are you doing :3

final iron
#

Finished my homework and discord bot time

#

Either going to implement documentation command, youtube search command or add a system so users can see how many commands were ran

cursive spindle
#
print(interaction.message.embeds[0].fields)

[EmbedProxy(value='Smaug#6390', name='MEMBERS', inline=True)]

how i can get only the field value?

cloud dawn
cloud dawn
final iron
final iron
#

I've seen it used in slash commands but I've never understood it

cursive spindle
cloud dawn
#
async def autocomplete_pypi(inter: ApplicationCommandInteraction, string: str) -> List[str]:
    return sorted([lang for lang in PACKAGES if string.lower() in lang.lower()][:25])
#

Using a list limiter [:25]

#
    @slash_command(name="pypi")
    async def get_package_info(
        self, inter: ApplicationCommandInteraction,
        package: str = Param(autocomplete=autocomplete_pypi),
        hidden: bool = True
        ) -> Message:
#

Still have to think about what docs ill use and i need to make some kind of recursive dir function.

native wedge
#

how many resources does a discord bot take?

cloud dawn
native wedge
cloud dawn
#

Message can also be a factor if only large messages are send.

final iron
pliant gulch
#

😔 sorted is O(n log n)

cloud dawn
cloud dawn
cloud dawn
native wedge
left crater
#

I want my bot to scan a channel and take all the images and videos and append it in a list and then send it@bot.command(name="meme") async def on_message(message, ctx : commands.Context): if message.channel.id == 699577970117050399: meme_list = [] if message.attachments.url.endswith('png') or message.attachments.url.endswith('jpg') or message.attachments.url.endswith('jpeg') or message.attachments.url.endswith('mp4') or message.attachments[0].url.endwith('gif'): url = message.attachments.url meme_list.append(url) list_len = len(meme_list) rand = random.randrange(list_len) await ctx.send(meme_list[rand])

final iron
cloud dawn
final iron
#

Could you explain how I would create an autocomplete system?

pliant gulch
cloud dawn
#

package: str = Param(autocomplete=autocomplete_pypi) will be assigned as suggestion.

cloud dawn
pliant gulch
cloud dawn
#

What's not good about sorting it then?

pliant gulch
#

Dict's are sorted already

#

And sorted is O(n log n)

final iron
#

Looks interesting

#

How do you get a list of the pypi packages?

#

Wait

#

nvm I'm dumb

cloud dawn
#

Not going to add the whole pypi database.

pliant gulch
cloud dawn
native wedge
#

how do i host a galaxygate bot

cloud dawn
native wedge
#

what host

cloud dawn
#

Servers are in germany though

final iron
#

Can I implement that myself?

#

Actually

#

Ill just create a task that calls the entire database

cloud dawn
slate swan
#

never used disnake before, or buttons. why does this still return a "interaction failed" even though the embed changes?

class Button(disnake.ui.View):
    @disnake.ui.button(style=disnake.ButtonStyle.blurple, label='Click Me')
    async def button(self, button: disnake.ui.Button, interaction: disnake.Interaction):
        embed = disnake.Embed(title='Clicked!', description='You clicked the button') 
        await interaction.message.edit(embed=embed)

@bot.listen('on_ready')
async def on_ready():
    print('Ready and roaring to go!')

@bot.slash_command(description="Responds with 'World'")
async def hello(interaction):
    await interaction.response.send_message("World", view=Button())
pliant gulch
#

You have to respond to an interaction otherwise discord API considers it dead/failed

#

You can send a DEFER response payload

slate swan
#

so

#

interaction.response.defer() yeah?

#

yep it works

#

godspeed, andy

final iron
#

So, just getting started with slash commands

#

How would I use them inside a cog?

#

I'm using disnake

#

Actually I think I figured it out

#

slash_command

#

So since the slash commands don't get registered instantly, should I only register them in my guild until I know they're working and then release them to the public?

cloud dawn
#

test_guilds=[926115595307614249, 561662622827806721]

#

Inside the class constructor

final iron
#

Okay well, first error

#
SyncWarning: Failed to overwrite commands in <Guild id=926959868248739840> due to 403 Forbidden (error code: 50001): Missing Access
  warnings.warn(
#

Whenever I run the bot

final iron
cloud dawn
#

Ohh you need to enable application command when the bot joins

final iron
#

What do you mean?

cloud dawn
final iron
#

I see

#

So now I have to kick and reinvite the bot?

cloud dawn
#

Basically

final iron
#

Yeah ik

#

Discord gives you a url

cloud dawn
final iron
#

So do I need to change my invite?

#

I mean my main one

cloud dawn
#

For slash yeah

final iron
#

Alr

cloud dawn
#

You need the application command.

final iron
#

Its working now

reef trail
#

how do you get an image from an embed

cloud dawn
reef trail
#

oh hi panda, im trying to make a command to go through a channels message history and save an image in an embed, but i dont know how to get the image from the embed

cloud dawn
#

So from a message object

reef trail
#

yeah, say a bot sends a embed with a image in the embed, i wanna be able to get that image and save it

#

i know how to save files, just not files in embeds

cloud dawn
#

Never done this looking at the docs

reef trail
#

alright

#

Im going through my bots autoposting channel and planning on adding some of those images to an api

cloud dawn
#

message.embeds should get us started

#

Okay coding some stuff now

reef trail
#
async with ctx.channel.typing():
    async for message in channel.history(limit=None, oldest_first=True):
        if message.embeds:
            for embed in message.embeds:
                if embed.image:
                    if embed.image.proxy_url:
                        await embed.image.save(os.path.join(folder_name, embed.image.url.filename))
``` this is what i have so far, i keep getting `CommandInvokeError: Command raised an exception: TypeError: join() argument must be str, bytes, or os.PathLike object, not '_EmptyEmbed'`
cloud dawn
#

Let's try to get the urls first

reef trail
#

alright

#

should just be embed.image.url

native wedge
#

how do i make a thing that prints when the bot is online? in the console

reef trail
native wedge
#

ty

reef trail
#

np

native wedge
#

its {0.user} for the bot right?

reef trail
#

umm

cloud dawn
#
for embed in [embed for embed in message.embeds if embed.image]:
    print(embed.image.url)
cloud dawn
wispy spade
cloud dawn
#

!f-strings

unkempt canyonBOT
#

Creating a Python string with your variables using the + operator can be difficult to write and read. F-strings (format-strings) make it easy to insert values into a string. If you put an f in front of the first quote, you can then put Python expressions between curly braces in the string.

>>> snake = "pythons"
>>> number = 21
>>> f"There are {number * 2} {snake} on the plane."
"There are 42 pythons on the plane."

Note that even when you include an expression that isn't a string, like number * 2, Python will convert it to a string for you.

cloud dawn
#

Modern method

cloud dawn
# reef trail lemme try this

You don't have to check if a list is empty or not with if since an empty list will be iterated the for loop will do nothing.

native wedge
#

so py @bot.event is the right way to make events now?

native wedge
cloud dawn
unkempt canyonBOT
#

@listen(name=None)```
A decorator that registers another function as an external event listener. Basically this allows you to listen to multiple events from different places e.g. such as [`on_ready()`](https://docs.disnake.dev/en/latest/api.html#disnake.on_ready "disnake.on_ready")

The functions being listened to must be a [coroutine](https://docs.python.org/3/library/asyncio-task.html#coroutine "(in Python v3.10)").

Example...
cloud dawn
#
async with ctx.channel.typing():
    async for message in channel.history(limit=None, oldest_first=True):
        for embed in [embed for embed in message.embeds if embed.image]:
            print(embed.image.url)
            # await embed.image.save(os.path.join(folder_name, embed.image.url.filename))
#

embed.image does not have .save though

reef trail
#

lemme try with the save now

unkempt canyonBOT
#
Not likely.

No documentation found for the requested symbol.

cloud dawn
#

!d disnake.Member.banner

unkempt canyonBOT
#

property banner```
Equivalent to [`User.banner`](https://docs.disnake.dev/en/latest/api.html#disnake.User.banner "disnake.User.banner")
cloud dawn
#

!d disnake.Asset.url

unkempt canyonBOT
cloud dawn
#

aka ```
member.banner.url

#

Gotta agree that the docs are kind of weird about that one.

#

Best fork there is :3

#

What is the best fork then?

reef trail
#
CommandInvokeError: Command raised an exception: AttributeError: 'str' object has no attribute 'filename'``` @cloud dawn
reef trail
#
@commands.command(name="download")
@commands.check(permissions.is_owner)
async def download_channel(self, ctx, channel: discord.TextChannel, folder_name):
    if not os.path.exists(folder_name):
        os.mkdir(folder_name)
        
    if not channel:
        await ctx.send("You need to specify a channel!")
        return

    await ctx.send(
        f"Downloading all files in {channel.mention}"
    )
    async with ctx.channel.typing():
        async for message in channel.history(limit=None, oldest_first=True):
            for embed in [embed for embed in message.embeds if embed.image]:
                await embed.image.save(os.path.join(folder_name, embed.image.url.filename))

ill add an asyncio sleep whenever this works

cloud dawn
# reef trail ```py @commands.command(name="download") @commands.check(permissions.is_owner) a...
@commands.command(name="download")
@commands.check(permissions.is_owner)
async def download_channel(self, ctx, channel: discord.TextChannel, folder_name):
    if not os.path.exists(folder_name):
        os.mkdir(folder_name)
        
    if not channel:
        await ctx.send("You need to specify a channel!")
        return

    await ctx.send(
        f"Downloading all files in {channel.mention}"
    )
    async with ctx.channel.typing():
        async for message in channel.history(limit=None, oldest_first=True):
            for embed in [embed for embed in message.embeds if embed.image]:
                await embed.image.save(os.path.join(folder_name, embed.image.key))
``` What about this
reef trail
#

lets see

modest plover
#

I'm hosting my bot on my phone
The more commands that get used at a time across a number of servers, would that end up making the phone's battery die faster if it were just idle?

native wedge
#

my bot got api blocked, how do i unblock it and avoid that?

modest plover
#

Well what was the bot doing?

#

Like before it got API blocked

cloud dawn
slate swan
#

ok i suck

reef trail
# cloud dawn ```py @commands.command(name="download") @commands.check(permissions.is_owner) a...
  File "/home/ubuntu/.local/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 994, in invoke
    await ctx.command.invoke(ctx)
  File "/home/ubuntu/.local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 894, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/home/ubuntu/.local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 176, in wrapped
    raise CommandInvokeError(exc) from exc
CommandInvokeError: Command raised an exception: TypeError: join() argument must be str, bytes, or os.PathLike object, not '_EmptyEmbed'```

same error like before
slate swan
#
@bot.command()
async def hack(ctx, *, word):
    embed = discord.Embed(title=f"Hacking {word}", description="Starting the main frame", colour=0xFAEB1A)
    await ctx.send(embed=embed)
#

not working

#

word is a required argument that is missing

native wedge
reef trail
slate swan
#

yes

#

like

#

whats ur prefix: $

#

then $hack max

reef trail
#

so are u doing $hack something

slate swan
#

$hack nasa

worthy wagon
#

Well, you have a *,

slate swan
#

yes

reef trail
#

ah yeah remove the *

worthy wagon
#

You don't need that.

#

You only have 1 arg.

slate swan
#

ok but what if the guys

cloud dawn
#

!d os.path.join

unkempt canyonBOT
#

os.path.join(path, *paths)```
Join one or more path components intelligently. The return value is the concatenation of *path* and any members of **paths* with exactly one directory separator following each non-empty part except the last, meaning that the result will only end in a separator if the last part is empty. If a component is an absolute path, all previous components are thrown away and joining continues from the absolute path component.
slate swan
#

name is like max (something)

worthy wagon
#

You tag him?

slate swan
#

rip i just leaked my name

worthy wagon
#

It'll still count as one.

reef trail
slate swan
#

im not on the internet anywys

reef trail
native wedge
worthy wagon
reef trail
#

sending a message, connecting to a channel, even errors

native wedge
slate swan
#

is there a way that like

reef trail
#

oh yeah probably, connecting makes a lot of requests

slate swan
#

if you do $hack

#

without putting someting after

wispy spade
cloud dawn
# reef trail ```py File "/home/ubuntu/.local/lib/python3.9/site-packages/discord/ext/comman...
@commands.command(name="download")
@commands.check(permissions.is_owner)
async def download_channel(self, ctx, channel: discord.TextChannel, folder_name):
    if not os.path.exists(folder_name):
        os.mkdir(folder_name)
        
    if not channel:
        await ctx.send("You need to specify a channel!")
        return

    await ctx.send(
        f"Downloading all files in {channel.mention}"
    )
    async with ctx.channel.typing():
        async for message in channel.history(limit=None, oldest_first=True):
            for embed in [embed for embed in message.embeds if embed.image]:
                await embed.image.save(f"./{folder_name}/{embed.image.key}.png")
slate swan
#

it sends like "cant hack nothing bro"

#

or something

worthy wagon
#

Make an if statement, that says if the arg is none

#

then the bot replies with that

reef trail
#

hence the .filename

cloud dawn
reef trail
#

uhh

worthy wagon
#
@bot.command()
async def hack(ctx, word=None):
    if word == None:
        await ctx.send(f"{ctx.message.author.mention}, You can't hack **air** bro.")
    else:
        embed = discord.Embed(title=f"Hacking {word}", description="Starting the main frame", colour=0xFAEB1A)
        await ctx.send(embed=embed)

@slate swan

worthy wagon
#

bro what

slate swan
#

idk

reef trail
#

if arg is None: do that instead man

slate swan
#

i just took ur statement

cloud dawn
slate swan
#

probably shouldnt be a programmer i suck

worthy wagon
worthy wagon
#

nothing wrong with being bad at something you just started

final iron
#

Damn. I actually like slash commands

worthy wagon
reef trail
slate swan
#

fr as in france

#

or??

worthy wagon
#

sure

final iron
#

I think Discord just released them too early

worthy wagon
#

why not

final iron
#

And ruined peoples opinions

#

Now with auto complete its so nice

cloud dawn
# cloud dawn ```py @commands.command(name="download") @commands.check(permissions.is_owner) a...
@commands.command(name="download")
@commands.check(permissions.is_owner)
async def download_channel(self, ctx, channel: discord.TextChannel, folder_name):
    if not os.path.exists(folder_name):
        os.mkdir(folder_name)
        
    if not channel:
        await ctx.send("You need to specify a channel!")
        return

    await ctx.send(
        f"Downloading all files in {channel.mention}"
    )
    async with ctx.channel.typing():
        async for message in channel.history(limit=None, oldest_first=True):
            for embed in [embed for embed in message.embeds if embed.image]:
                await embed.image.save(f"./{folder_name}/{embed.image.key}.{'gif' if embed.image.is_animated() else 'png'}")
worthy wagon
#

I'm pretty sure slash commands got released early because of the d.py issue

#

That it was expiring or something like that

final iron
#

What?

worthy wagon
#

That's what I was told

cloud dawn
#

We're third party Discord doesn't care

final iron
#

I just think discord didn't realize how bad they were at the time

slate swan
#

ok i dont understand

worthy wagon
#

discord doesn't realize how bad they are sometimes

slate swan
#
@bot.command()
async def hack(ctx, word, arg):
    if word is None:
        await ctx.send('Can\'t hack nothing')
    embed = discord.Embed(title=f"Hacking {word}", description="Starting the main frame", colour=0xFAEB1A)
    await ctx.send(embed=embed)
worthy wagon
#

I gave you the code earlier man.

final iron
slate swan
#

well i stol e the

#

if word is None part

final iron
#

If a user doesn't input it, it throws an error

worthy wagon
#

Well, you still have to add another arg.

#

Cause you have 2 in there

slate swan
#

oh kk

worthy wagon
#

So it'd be $hack stuff stuff

reef trail
slate swan
#

how do u guys sell ur bots

worthy wagon
#

you don't?

slate swan
#

if you do

final iron
#

We don't

reef trail
#

none of us do

slate swan
#

okok why not

reef trail
#

imo code isnt worth a price

slate swan
#

learning and earning

final iron
#

At most, people will gate certain features behind a paywall

worthy wagon
#

If you sell bots you're strange, cause people who sell bots, don't realize, half of the bots already created, beat their bot in every single shape, way and form.

cloud dawn
worthy wagon
#

still bro

cloud dawn
#

You can't really earn anything by selling your bot.

reef trail
#

lemme rephrase, anyone can learn how to code, so it shouldnt be locked behind something if you can just learn how to do it yourself for free

slate swan
#

id sell my liver for 10$

worthy wagon
#

😐

final iron
slate swan
#

ok

final iron
#

Basically every command has been made

#

There is very little originality

slate swan
#

how much are u betting

#

im betting 10$

worthy wagon
#

except for a command that predicts when elon musk will release flying cars

final iron
#

Nothing

slate swan
#

ok i bet

#

10$

worthy wagon
#

how about you use that $10 and buy some nitro

cloud dawn
#

Most if not all bots are open source

final iron
#

The Discord bot space right now isn't originality. Its who can pack the most commands in to a single bot and still have a good user interface

slate swan
#

ok wait

#

should i make a file for every command

reef trail
slate swan
#

like a file for dog another for pizza

#

etc

final iron
cloud dawn
final iron
#

You're going to end up with a ton of files

reef trail
#

ughhh

slate swan
#

ok

#

okokokokok

cloud dawn
#

Kind of glad they added a 50 command max on slash bots. A lot of people were complaining like my bot has 230 commands uwu
Like who needs that many.

slate swan
#

ok but why learn programming in the first place

final iron
#

Wait

hard trail
#

Question: Is it possible for a bot editing a role/message that it just breaks and the editing just stops and no matter what you do it stays that way?

slate swan
#

what will it teach me

cloud dawn
final iron
#

If there is a 50 command cap on slash commands doesn't that fuck over the verified bots since after april they can only use slash commands?

#

Since after like April they can only use slash commands?

slate swan
#

i know like the html5s and the css3s

#

and a bit of python

cloud dawn
slate swan
#

can python work with css3

hard trail
final iron
#

You'll get there

cloud dawn
worthy wagon
hard trail
#

That it basically just "freaks out" and stops working

slate swan
#

okokokokokokok

worthy wagon
#

That's like, 10 percent of my bots commands

slate swan
#

so i can replace javascript with python

#

right

cloud dawn
slate swan
#

python > every other programming language thats ever created ever

worthy wagon
#

uhhhhhhhhhhhhhh

cloud dawn
slate swan
worthy wagon
#

That's up to you man

slate swan
#

rlly

final iron
hard trail
cloud dawn
worthy wagon
#

We're only here to help with python, as this is a python discord.

slate swan
#

NOOO

#

ok python related question here

#

what should the "hack" command do

final iron
#

If there is a 50 command cap on slash commands doesn't that fuck over the verified bots since after april they can only use slash commands?

#

Or does the limit increase for them

cloud dawn
cloud dawn
#

Unless you are not verified

slate swan
#

ok can i change the message

#

like example

#

changing the words

#

to then getting ip

final iron
#

!d discord.Message.edit

unkempt canyonBOT
#

await edit(content=..., embed=..., embeds=..., attachments=..., suppress=..., delete_after=None, allowed_mentions=..., view=...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Edits the message.

The content must be able to be transformed into a string via `str(content)`.

Changed in version 1.3: The `suppress` keyword-only parameter was added.
slate swan
#

idk whatever, just dont want to delete it and make a new and delete etc

#

nice

reef trail
#

@cloud dawn okay so embed.image.save just doesnt work, printing the image url's work fine

slate swan
#

all of you are life savers

#

ok maybe not life

cloud dawn
#

You can then also send the whole list to a function and tell the user it is downloading in the background.

hard trail
#

For example: You code a bot that can edit messages REALLY fast and it just breaks

final iron
cloud dawn
#

It's like the grey messages you get when spamming

#

But then the bot would just say no

hard trail
slate swan
#

ok whats ur iq

#

what do u think it is

#

like 200

#

or something

cloud dawn
#

?

slate swan
#

idk

#

im thinking like 80

cloud dawn
#

Please keep it on topic, a bit off topic is fine but this is just random.

final iron
#

Does bot.commands include slash commands?

cloud dawn
#

from disnake.ext.commands import slash_command

cloud dawn
#

no idea

slate swan
#

is discord py outdated

cloud dawn
#

Not likely @final iron

#

Looks like you would need this

#

!d disnake.ext.commands.InteractionBot.global_slash_commands

unkempt canyonBOT
cloud dawn
#

idk if they return if you got test guilds on though

severe rampart
#

any ideas why my slash commands aren't working?

[WARNING] Failed to overwrite commands in <Guild id=930562118359588904> due to 403 Forbidden (error code: 50001): Missing Access

they had the above error, here's an example of one:

    @commands.slash_command(
        name="ping",
        description="returns bot latency",
        guild_ids=[923632089834864690, 930562118359588904],
    )
    async def get_ping(self, inter: ApplicationCommandInteraction):
        em = disnake.Embed(
            title="Pong! 🏓",
            color=0xD3D3D3,
            description=f"Latency: {round(self.client.latency * 1000)}ms",
        )
        await inter.send(embed=em, ephemeral=True)
#

i'll ask in a help channel if none of y'all know

iron sorrel
#

what lib are u using btw

severe rampart
iron sorrel
#

whats guild ids

severe rampart
iron sorrel
#

oh ok

#

so only in those?

severe rampart
#

i made it just those because

#

it said it would take like 12h to register globally soz

#

you can manually do it easier than that but it just didn't want me to ig

iron sorrel
#

globally register a slash command jeez

severe rampart
#

¯_(ツ)_/¯

#

they're gonna be required eventually soz

#

if i can learn it that sames u some trouble

severe rampart
#

first attempt

cloud dawn
#

Has any slash command worked?

severe rampart
#

in those servers by other bots, yes

#

not my own tho, this was the first time i tried to set up my own

iron sorrel
iron sorrel
#

EVER has ANY SLASH COMMAND EVER WORKED?

iron sorrel
cloud dawn
iron sorrel
#

yes

#

what do they do

severe rampart
#

oh..

#

sad....

#

so i have to reinvite it...?

iron sorrel
#

that make them so special

pliant gulch
#

there is just no clean way to do them in python!

#

This is obviously more suited for javascript wrappers

#

😔

cloud dawn
pliant gulch
#

Bro... just look at that decorator

iron sorrel
#

yuck

severe rampart
#

disnake is nice

cloud dawn
#

😂

iron sorrel
#

but it works

severe rampart
#

it's not too bad?

#

all you really need is

#
@bot.slash_command(name = "x")
iron sorrel
#

🤷 slowmode annoying

severe rampart
#

right?

iron sorrel
#

ok thats

cloud dawn
iron sorrel
#

fair enough but what about it not being ctx

severe rampart
#

uses inter

#

instead of ctx

#

it's very intuitive actually

cloud dawn
#

Wouldn't make sense to call it ctx

pliant gulch
cloud dawn
severe rampart
#

why u complaining rn

cloud dawn
#

😂

severe rampart
#

if you don't like it just ignore it

#

it's what i'm about to start doing with you-

cloud dawn
#

Andy just likes to be thorough.

pliant gulch
severe rampart
#

/j