#discord-bots

1 messages ยท Page 832 of 1

slate swan
final iron
#

Just typehint your userid arg to discord.Member

maiden fable
#

PoV: They copy paste what u said and come with a required arg error

final iron
#

Then you can use the ban method on it

#

Without having to do some trickery

slate swan
final iron
#

๐Ÿ—ฟ

final iron
slate swan
#

: user ?

final iron
#

i.e

my_var: str = "my string"
final iron
#

my_var was type hinted to str

nimble plume
#

im not dumb ๐Ÿ˜ก

slate swan
nimble plume
#

no i just obsered i mistakely copy paste the same code somewhere in other cogs file which was pending it was giving error

#
         elif not channel1:
             channel1 = await ctx.guild.create_voice_channel("PRVC-1", category=category)
             await channel1.set_permissions(ctx.guild.default_role, overwrite=overwrite)
             await channel1.set_permissions(ctx.author, overwrite=overwrite2)
             ownvc.append(ctx.author.id)
             s = disnake.Embed(title="Created a Private voice PRVC-1",description="use : `!prvc modify`",color=green,timestamp=datetime.utcnow())
             await ctx.reply(embed=s)
```succesfully creates channel + sends message but didnt append the item @slate swan
#
  • no error at all
#

ownvc = []

final iron
#

When you print ownvc what gets printed

nimble plume
#

[]
#

huh?

slate swan
#

two pings?

nimble plume
final iron
nimble plume
#

!paste

unkempt canyonBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

vale wing
slate swan
#

no one's gonna steal your code

nimble plume
#

whole command i edited till now

#

@final iron

final iron
#

Oh god

#

Pep8 is screaming

nimble plume
#

why

slate swan
#

Command groups be like : shipit

nimble plume
#

๐Ÿ˜…

nimble plume
nimble plume
unkempt canyonBOT
#

Hey @grim topaz!

You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.

#

Hey @grim topaz!

You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.

maiden fable
nimble plume
#

all died after seeing my code

maiden fable
#

What did I just see...

nimble plume
unkempt canyonBOT
maiden fable
#

Dude please use a for loop and list

potent spear
#

if channel with that name already exists: skip

nimble plume
maiden fable
# nimble plume where

Just make a list with all the channel named and do something like

for cnl in cnl_list:
    channel = utils.get(...) 
    if not channel:
        await guild.create_voice_channel(name=cnl) 
slate swan
#

@slate swan good luck btw

#

Youre working from before

maiden fable
#

Uhhh?

slate swan
unkempt canyonBOT
#

@group(*args, **kwargs)```
A shortcut decorator that invokes [`group()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.group "discord.ext.commands.group") and adds it to the internal command list via [`add_command()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.GroupMixin.add_command "discord.ext.commands.GroupMixin.add_command").
maiden fable
#

Sooo?

nimble plume
#

channel = what

maiden fable
#

....?

#

utils.get(guild.channels, name=cnl)

nimble plume
#

ok..

maiden fable
#

It will either return None or the Channel object

kindred drum
#
elif type == "address":
                try:
                    for i in range (0, len(Json_Items)):
                        for x in Json_Items[i]:
                            for c in Json_Items[i][x]:
                                if (','.join(Json_Items[i][x]["Payment Address"])) == str(id):
                                    print("hello")
                                    done = True
                                    break
                                else:
                                    if done == False:
                                        print("bye")
                                    done = True```
yo how do I make this code stop if it detects a real address? and only print "bye" once if it detects a fake one? right now it just prints both depending on the number of items in Json_Items
nimble plume
potent spear
slate swan
dense coral
#
@bot.command()
async def new(ctx, member:discord.Member=None, *,message=None):
  guild = ctx.guild
  if member == None:
    return await ctx.reply("ื ื ืœืชื™ื™ื’ ืžื™ืฉื”ื•")
  if message == None:
    return await ctx.reply("ืœืจืฉื•ื ื”ื•ื“ืขื”.")
  embed=discord.Embed(title=f"{message}", description="ืœื—ืฅ ื›ื“ื™ ืœื”ืฆื‘ื™ืข")
  embed.add_field(name="Owner", value=f"{member.mention} ({member})", inline=False)
  new_channel = await ctx.guild.create_text_channel(name=f"{message}", category="Servers")
  channel = ctx.guild.get_channel(new_channel.id)
  msg = await new_channel.send(embed=embed)
  await msg.add_reaction("![YesClapzy](https://cdn.discordapp.com/emojis/930545556525285396.webp?size=128 "YesClapzy")")```
Not working, Error:
slim ibex
#

Which line raises it

kindred drum
slim ibex
#

break keyword

slate swan
slate swan
kindred drum
#

is that when it finds a fake one

#

first, it still outputs the fake one

#

how do I like make it only output once its done

#

I just explained it to you

#

and found the issue bro was stuck on that for lik ean hour

slate swan
# kindred drum is that when it finds a fake one

kiss_uhhh if statement and continue keyword, idk if you're working with an api to check the address is real or fake, anyways if the api print "fake" if the address is fake then you gotta do py if idk == "fake": print("bye") continue

#

idk tbh

potent spear
#

try and see
it will most likely not work, and you should perfectly know why

slate swan
#

U need await

#

await channel.send

slate swan
potent spear
#

also that ^ AND the if statement will never be True

potent spear
dense coral
#

Yes

slate swan
potent spear
#

you need to get the category with utils get

dense coral
potent spear
#

your "Servers" is the problem

slate swan
dense coral
#

Oh, ok

slate swan
#

!d discord.utils.get

unkempt canyonBOT
#

discord.utils.get(iterable, **attrs)```
A helper that returns the first element in the iterable that meets all the traits passed in `attrs`. This is an alternative for [`find()`](https://discordpy.readthedocs.io/en/master/api.html#discord.utils.find "discord.utils.find").

When multiple attributes are specified, they are checked using logical AND, not logical OR. Meaning they have to meet every attribute passed in and not one of them.

To have a nested attribute search (i.e. search by `x.y`) then pass in `x__y` as the keyword argument.

If nothing is found that matches the attributes passed, then `None` is returned.

Examples

Basic usage...
dense coral
#

tanks

nimble plume
#

@maiden fable

             for channel in vclist:
                  get = disnake.utils.get(ctx.guild.voice_channels, name=channel)
                  if not get:
                     channel12 = await ctx.guild.create_voice_channel(name=channel, category=category)
                     await channel12.set_permissions(ctx.guild.default_role, overwrite=overwrite)
                     await channel12.set_permissions(ctx.author, overwrite=overwrite2)
                     ownvc.append(ctx.author.id)
                     s = disnake.Embed(title=f"Created a Private voice {channel}",description="use : `!prvc modify`",color=green,timestamp=datetime.utcnow())
                     await ctx.reply(embed=s)
```fine
potent spear
#

terrible variable names tbh

nimble plume
potent spear
#
  1. error says it all
  2. you should know why your if statement will never be True
    you use a - to connect the name and discriminator
potent spear
nimble plume
potent spear
#

people who try to help you

nimble plume
#

lol

potent spear
#

all fun and games until someone has to decypher whatever those variables actually represent

nimble plume
#

ok

#
         else:
             for channel in vclist:
                  get = disnake.utils.get(ctx.guild.voice_channels, name=channel)
                  if not get:
                     createdchannel = await ctx.guild.create_voice_channel(name=channel, category=category)
                     await createdchannel.set_permissions(ctx.guild.default_role, overwrite=overwrite)
                     await createdchannel.set_permissions(ctx.author, overwrite=overwrite2)
                     ownvc.append(ctx.author.id)
                     messageembed = disnake.Embed(title=f"Created a Private voice {channel}",description="use : `!prvc modify`",color=green,timestamp=datetime.utcnow())
                     await ctx.reply(embed=messageembed)
``` fine
potent spear
#

get, channel

nimble plume
#

channel is fine?

potent spear
#

what channel? a vc/ textchannel/categorychannel / ...

#

and what's its purpose? like a send_message_channel, so you know you'll need it in the end etc etc

nimble plume
#
         else:
             for channelname in vclist:
                  gettingchannel = disnake.utils.get(ctx.guild.voice_channels, name=channelname)
                  if not gettingchannel:
                     createdchannel = await ctx.guild.create_voice_channel(name=channel, category=category)
                     await createdchannel.set_permissions(ctx.guild.default_role, overwrite=overwrite)
                     await createdchannel.set_permissions(ctx.author, overwrite=overwrite2)
                     ownvc.append(ctx.author.id)
                     messageembed = disnake.Embed(title=f"Created a Private voice {channelname}",description="use : `!prvc modify`",color=green,timestamp=datetime.utcnow())
                     await ctx.reply(embed=messageembed)
potent spear
#

you could make it current_vc, to refer to it as you're looping through it, ...

nimble plume
#
         else:
             for vcchannelname in vclist:
                  gettingchannel = disnake.utils.get(ctx.guild.voice_channels, name=vcchannelname)
                  if not gettingchannel:
                     createdchannel = await ctx.guild.create_voice_channel(name=channel, category=category)
                     await createdchannel.set_permissions(ctx.guild.default_role, overwrite=overwrite)
                     await createdchannel.set_permissions(ctx.author, overwrite=overwrite2)
                     ownvc.append(ctx.author.id)
                     messageembed = disnake.Embed(title=f"Created a Private voice {vcchannelname}",description="use : `!prvc modify`",color=green,timestamp=datetime.utcnow())
                     await ctx.reply(embed=messageembed)
potent spear
#

so vclist is a list of voicechannelnames?

nimble plume
#

yes

potent spear
#

then you could call that vc_names, etc etc etc

nimble plume
#
         else:
             for vcchannelname in vclist:
                  current_vc = disnake.utils.get(ctx.guild.voice_channels, name=vcchannelname)
                  if not current_vc:  
                     createdchannel = await ctx.guild.create_voice_channel(name=channel, category=category)
                     await createdchannel.set_permissions(ctx.guild.default_role, overwrite=overwrite)
                     await createdchannel.set_permissions(ctx.author, overwrite=overwrite2)
                     ownvc.append(ctx.author.id)
                     messageembed = disnake.Embed(title=f"Created a Private voice {vcchannelname}",description="use : `!prvc modify`",color=green,timestamp=datetime.utcnow())
                     await ctx.reply(embed=messageembed)
potent spear
#

also if I were to type out vcchannelname, it basically is voice channel channel name
so just vc_name is clear ig

nimble plume
#

stop

potent spear
#

you'll thank yourself later, you see it as a struggle

nimble plume
#

struggle

potent spear
#

yeah, you clearly hate it

nimble plume
#

nvmd

maiden fable
potent spear
#

in your category, you probably want to loop through OR text channels OR voice channels, not both

nimble plume
maiden fable
#

Yea

#

!d discord.Guild.create_voice_channel

unkempt canyonBOT
#

await create_voice_channel(name, *, reason=None, category=None, position=..., bitrate=..., user_limit=..., rtc_region=..., video_quality_mode=..., overwrites=...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

This is similar to [`create_text_channel()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild.create_text_channel "discord.Guild.create_text_channel") except makes a [`VoiceChannel`](https://discordpy.readthedocs.io/en/master/api.html#discord.VoiceChannel "discord.VoiceChannel") instead.
maiden fable
#

overwrites*

nimble plume
#

woah who deleted not me

maiden fable
#

Automatically

nimble plume
#

ok..

potent spear
#

also {interaction.user} isn't correct

#

first fix the first thing I said ofc

#

f""

nimble plume
#
             for vcchannelname in vclist:
                  current_vc = disnake.utils.get(ctx.guild.voice_channels, name=vcchannelname)
                  if not current_vc:  
                     createdchannel = await ctx.guild.create_voice_channel(name=channel, category=category , overwrite=overwrite)
                     await createdchannel.set_permissions(ctx.author, overwrite=overwrite2)
                     ownvc.append(ctx.author.id)
                     messageembed = disnake.Embed(title=f"Created a Private voice {vcchannelname}",description="use : `!prvc modify`",color=green,timestamp=datetime.utcnow())
                     await ctx.reply(embed=messageembed)
#

tf fine?

potent spear
nimble plume
potent spear
#

you'll have them for sure

nimble plume
potent spear
#
createdchannel = await ctx.guild.create_voice_channel(name=channel, category=category , overwrite=overwrite)
await createdchannel.set_permissions(ctx.author, overwrite=overwrite2)```
this can be one line
heavy fox
#

how do i make subcommands such as ,settings add {param1} {param2}
subcommand such as "add"

potent spear
nimble plume
#

i dont know anything about that

nimble plume
quick gust
#

!d discord.ext.commands.group

unkempt canyonBOT
#

@discord.ext.commands.group(name=..., cls=..., **attrs)```
A decorator that transforms a function into a [`Group`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Group "discord.ext.commands.Group").

This is similar to the [`command()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.command "discord.ext.commands.command") decorator but the `cls` parameter is set to [`Group`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Group "discord.ext.commands.Group") by default.

Changed in version 1.1: The `cls` parameter can now be passed.
heavy fox
#

alright ty

nimble plume
#
disnake.ext.commands.errors.CommandInvokeError: Command raised an exception: UnboundLocalError: local
variable 'channel' referenced before assignment

potent spear
#

error says it all

nimble plume
#

finaly gets error rofl

nimble plume
potent spear
nimble plume
#

change the varaible name

potent spear
#

yeah, of ALL the variables in that function ofc

potent spear
#

yeah, only the if statement needs a fix and you're done

potent spear
nimble plume
#
disnake.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: create_voice_channel() got an unexpected keyword argument 'overwrite'
``` overwite didnt work
nimble plume
potent spear
#

if channelname not equal to "username - user discriminator":
then send message and return

heavy fox
nimble plume
#

disnake.ext.commands.errors.CommandInvokeError: Command raised an exception: InvalidArgument: overwrites parameter expects a dict.

#

+1

potent spear
nimble plume
#

?

heavy fox
brave flint
#

anyone can show me a tag?

#

i wanna try making it

brave flint
#

!tags

unkempt canyonBOT
#
Available tags

โ€ข
ยป args-kwargs
ยป async-await
ยป blocking
ยป botvar
ยป class
ยป classmethod
ยป codeblock
ยป comparison
ยป contribute
ยป customchecks
ยป customcooldown
ยป customhelp
ยป decorators
ยป defaultdict

nimble plume
nimble plume
brave flint
potent spear
cloud dawn
unkempt canyonBOT
#
Command: tags

Show all known tags, a single tag, or run a subcommand.

Source Code
nimble plume
#
         else:
             for vcchannelname in vclist:
                  current_vc = disnake.utils.get(ctx.guild.voice_channels, name=vcchannelname)
                  if not current_vc:  
                     createdchannel = await ctx.guild.create_voice_channel(name=vcchannelname, category=category , overwrites=overwrite)
                     await createdchannel.set_permissions(ctx.author, overwrites=overwrite2)
                     ownvc.append(ctx.author.id)
                     messageembed = disnake.Embed(title=f"Created a Private voice {vcchannelname}",description="use : `!prvc modify`",color=green,timestamp=datetime.utcnow())
                     await ctx.reply(embed=messageembed)
```'
potent spear
slate swan
heavy fox
potent spear
nimble plume
potent spear
slate swan
nimble plume
#

i was not using dict for that/??~?~/

potent spear
slate swan
#

lol

nimble plume
#

overwrite = disnake.PermissionOverwrite()
overwrite.connect = False

potent spear
#

that's bad

#

permission for who?

nimble plume
#

working tho

potent spear
#

nope, not anymore

nimble plume
#

ok...

potent spear
#

remove the overwrite connect

nimble plume
#

ok

cloud dawn
unkempt canyonBOT
#

property overwrites: Dict[Union[Role, Member], PermissionOverwrite]```
Returns all of the channelโ€™s overwrites.

This is returned as a dictionary where the key contains the target which can be either a [`Role`](https://docs.disnake.dev/en/latest/api.html#disnake.Role "disnake.Role") or a [`Member`](https://docs.disnake.dev/en/latest/api.html#disnake.Member "disnake.Member") and the value is the overwrite as a [`PermissionOverwrite`](https://docs.disnake.dev/en/latest/api.html#disnake.PermissionOverwrite "disnake.PermissionOverwrite").
nimble plume
#

removed

potent spear
#

why don't you compare the channel name?

nimble plume
#

Im done im leaving

#

๐Ÿ˜ซ ๐Ÿ˜ฉ

potent spear
nimble plume
heavy fox
#

why isnt it getting ctx.author

nimble plume
#

Bye ill come tmrw

potent spear
nimble plume
quick gust
cloud dawn
nimble plume
heavy fox
#

i fixed it, i needed to change nowplaying(ctx, user)

nimble plume
#

I want to study my exam are close 10 days after my exams and i didnt learned anything

potent spear
#

seems like your if statement was false then

nimble plume
#

Same name channel spotted

#

Ill go and chill now on python general

potent spear
#

above the if, print ch.name and f"{interaction.user.name}-{interaction.user.discriminator}"
you can check for yourself
I know what the problem is tho, it has to do with casing

nimble plume
#

Ill add tmrw im done for now

#

Thankd for handling me im a trolling/irritating guy

#

Thanks for help

potent spear
#

just fix your variable names and your questions and you should be golden when asking questions

nimble plume
#

Sniper helped me a lot today

quick gust
#

sniper too good

nimble plume
#

Yes

potent spear
#

if you just want the fix:
it's interaction.user.name.lower()

nimble plume
#

Epic fail

potent spear
#

that'll fix it all

#

since channel names don't have casing, you were basically comparing
shit-151 with ShiT-151

#

which isn't the same ofc

#

correct

#

good luck

#

you're not taking a lot of stuff into account tho, you'll stumble upon some problems in the future
like: what if the user changes his username? he'll be able to keep on creating channels and his previous channel will never be deleted, ...

nimble plume
#

I dont want to lewrn about sql rn can i copy the code from somewhere

potent spear
#

yeah, but you'd have to be online for that etc, that's still a manual fix

#

also, if he does it once, you won't notice and the channel will just stay there or whatever

#

You could make a countdown, which deleted it x seconds / minutes after creation, the bot could optionally check if there's still movement in the channel and extend the deletion period

#

but that's just me brainstorming
just know that anything is possible and thinking about all possible outcomes is like 90% of the work

boreal ravine
potent spear
#

*aiosqlite or asyncpg => async wrappers of sqlite and postgres
mongo might be a last resort

boreal ravine
#

aiosqlite/asyncpg still requires you to use the SQL language

potent spear
#

true, I'm talking about best case scenario's

light violet
#

How to turn on community mode without audit record

#

@boreal ravine i have a doubt bro

#

Help pls

snow ibex
#

im trying to make the bot invoke a command on a button interaction
this is the button

@button(emoji="\u23F9")
    async def stop_command(self,button: button, interaction: disnake.MessageInteraction):
        """Stop button."""
        
        ctx = await interaction.bot.get_context(interaction.message)
        ctx.command = interaction.bot.get_command("stop")
        await interaction.bot.invoke(ctx)

the error i get

ctx = await interaction.bot.get_context(interaction.message)
AttributeError: 'NoneType' object has no attribute 'get_context'

what i tried:

print(interaction.bot)
# outputs: None
print(dir(interaction))
#outputs:
"""
['__annotations__', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__slots__', '__str__', '__subclasshook__', '__weakref__', '_cs_channel', '_cs_followup', '_cs_me', '_cs_response', '_from_data', '_original_message', '_permissions', '_session', '_state', 'application_id', 'author', 'bot', 'channel', 'channel_id', 
'client', 'component', 'created_at', 'data', 'delete_original_message', 'edit_original_message', 'followup', 'guild', 'guild_id', 'id', 'me', 'message', 'original_message', 'permissions', 'response', 'send', 'token', 'type', 'user', 'values', 
'version']
"""

additional info : I'm using disnake version: 2.1.0 on windows

maiden fable
#

update disnake

boreal ravine
#

so old

maiden fable
#

The latest is 2.4.0

snow ibex
#

any code breaking changes?

boreal ravine
maiden fable
snow ibex
#

ight

light violet
#

@boreal ravine i too knew it, btw some body changed my perception, global occult made a tool and he literally created a lots of community channels without any audit records

#

Howww??????

#

How did he do it, discord bug?

#

.

boreal ravine
#

๐Ÿคทโ€โ™€๏ธ

light violet
#

@boreal ravine i think he made request with any other id

#

And due to bug it got create on anogher guild

spring flax
#

how can I do a cooldown for an on_message event response?

snow ibex
potent spear
spring flax
#

if I use ctx.invoke on a on_message message, does the cooldown for the command apply?

potent spear
#

not sure if the cooldown does something

#

also converters won't trigger

light violet
#

@potent spear how to use def functions with taskpool

#

How to run them

potent spear
#

you want to run sync functions async?

light violet
#

No i want to use it like - async with taskpool(5_000) as pool:
Await pool.put(my def function) @potent spear

#

Will it work?

potent spear
#

for what use tho?

light violet
#

@potent spear i need to to take some commands and combine them together

hardy wing
#

Anybody got the docs or api for coding discord gui i cant seem to find it on google

light violet
#

@potent spear i liked ur about me

#

@hardy wing search discord py docs

potent spear
hardy wing
#

The gui is included in there?

potent spear
potent spear
light violet
#

@potent spear no i need to use taskpool for fast loop

potent spear
light violet
#

@potent spear using taskio

#

@potent spear ok simply tell me i dont want loop but how do i call any async function

potent spear
light violet
#

@potent spear bruh
@client.command i need

#

Making a command

potent spear
light violet
#

I know how to btw dont know how to call async function

potent spear
light violet
#

Ok ok

#

@potent spear will it work in def!?

potent spear
#

in def, you need to use run_in_executor

light violet
#

I need that only

#

.

#

Cant i use target thread?

#

@potent spear ok leave this

#

I need to know another thing

potent spear
# light violet I need that only
import asyncio

async def shit(...):
  #async stuff

def sync_shit(..):
  loop = asyncio.get_event_loop()
  loop.run_until_complete(shit(...))```
light violet
#

@potent spear how to make my bot check everyone's sttaus at regular intervals automatically?

light violet
#

@potent spear example?

slate swan
#

!d discord.ext.tasks.loop

unkempt canyonBOT
#

discord.ext.tasks.loop(*, seconds=..., minutes=..., hours=..., time=..., count=None, reconnect=True, loop=...)```
A decorator that schedules a task in the background for you with optional reconnect logic. The decorator returns a [`Loop`](https://discordpy.readthedocs.io/en/master/ext/tasks/index.html#discord.ext.tasks.Loop "discord.ext.tasks.Loop").
light violet
#

@slate swan did u block me?

slate swan
#

click on the link, you will get an example

light violet
#

Ok

potent spear
slate swan
light violet
#

Ok

#

@slate swan ok, what to write in loop? Async def func or wott

#

or just normally

#

Put code

slate swan
#

see the example sniperglitcherz sent

light violet
#

Ok

#

Ok

spring flax
#

for ctx.invoke, if I have a command

async def example(ctx, member : disnake.Member):
  pass```
and i have an on_message event
```py
async def on_message(message):
  if message.content == 'somethinng':
    await ctx.invoke(bot.get_command('example', member=message.author)```?
light violet
#

@slate swan can we use taskpool(10_000)?

cloud folio
#

Hello, what can I do about AttributeError: 'NoneType' object has no attribute 'clone' error?

hardy wing
#

is replit down for anyone else rn

cloud folio
spring flax
quick gust
#

make sure the ID is correct

maiden fable
#

!d discord.ext.commands.Bot.get_context

unkempt canyonBOT
#

await get_context(message, *, cls=<class 'discord.ext.commands.context.Context'>)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Returns the invocation context from the message.

This is a more low-level counter-part for [`process_commands()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.process_commands "discord.ext.commands.Bot.process_commands") to allow users more fine grained control over the processing.

The returned context is not guaranteed to be a valid invocation context, [`Context.valid`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Context.valid "discord.ext.commands.Context.valid") must be checked to make sure it is. If the context is not valid then it is not a valid candidate to be invoked under [`invoke()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.invoke "discord.ext.commands.Bot.invoke").
quick gust
#

if possible show json file structure aswell

maiden fable
#

Use this for the ctx arg

spring flax
maiden fable
#

Idrk tbh... Why will u want to do that thing tho

spring flax
maiden fable
#

!d discord.ext.commands.Command.is_on_cooldown

unkempt canyonBOT
rotund nova
spring flax
maiden fable
#

u didn't install those

maiden fable
grim topaz
#

py -m pip install discord

spring flax
#

it'll apply right?

grim topaz
#

and next restart vs code

maiden fable
rotund nova
spring flax
maiden fable
#

Ah okay

tidal hawk
#

SyncWarning: Failed to overwrite commands in <Guild=123123123123> due to 400 Bad Request (error code: 50035): Invalid Form Body

#

Why does it occur?

potent spear
tidal hawk
#

Only possible wrong place must be here, but it's correct..

potent spear
#

print it to be sure...

rotund nova
left dawn
#

python -m

left dawn
quick gust
#

I recently decided to make a database wrapper for my bot for the sake of cleanliness, but it keeps inserting NULL when I change my prefix

This is insert_prefix

    async def insert_prefix(self, guild_id: int, prefix: str):
        """Called only while executing update_prefix"""
        await self.db.execute(
            "INSERT INTO prefixes (guild_id, prefix) VALUES (?1, ?2)",
            [guild_id, prefix],
        )
        return await self.db.commit()```
tidal hawk
gaunt ice
#

or is it personal one

quick gust
#

Oh its public

left dawn
#

Also, please don't call a bot client, for everyone's sake

gaunt ice
#

so u want it to be published?

quick gust
#

who's doing that?

tidal hawk
#

shut up xD

#

old habits

quick gust
#

oh sink

quick gust
gaunt ice
#

umm like

tidal hawk
#

But it's not gonna fix the problem so idc xd

gaunt ice
#

public ok

quick gust
#

yeah

gaunt ice
#

mongo ?

quick gust
#

aiosqlite

gaunt ice
#

or sql

rotund nova
gaunt ice
#

okk

left dawn
tidal hawk
#

Oh i just spammed random nr's to hide if for no reason

gaunt ice
#

um u dont wanna know the guild id do u

rotund nova
spring flax
quick gust
spring flax
maiden fable
#

Yea

spring flax
#

how do I apply the cooldown exactly?

maiden fable
#

So u want to know when the command will be ready to be used again?

tidal hawk
#

May some driop menu be the cause of this error?

boreal ravine
#

to atleast 2.4.0

tidal hawk
#

Thanks bud

maiden fable
unkempt canyonBOT
spring flax
#

ah I can asyncio.sleep that time

echo wasp
#

Hello, I asked this question before but can I use absolute path to map to a different env than the one in the folder?

rotund nova
gaunt ice
rotund nova
#

dont works?

potent spear
#

error says it all or run as admin...

rotund nova
#

ok

echo wasp
#

Can I see an example on how todo it with my setup?py load_dotenv() TOKEN = os.getenv('DISCORD_TOKEN') GUILD = os.getenv('DISCORD_GUILD') intents = discord.Intents.default() intents.members = True

rotund nova
#

i already have

gaunt ice
echo wasp
#

do you have python3?

rotund nova
#

i install 3.10.2 10 minutes ago

echo wasp
#

try useing python3 - m pip install --upgrade pip

rotund nova
pliant gulch
#

Try python -m ensurepip --upgrade

rotund nova
pliant gulch
#

Seems like it worked?

rotund nova
#

yea

#

i got this

pliant gulch
rotund nova
#

ok

potent spear
spring flax
#

how do i use bot.get_context?

potent spear
#

why do you need it?

spring flax
#

it's var = await bot.get_context(message) right?

spring flax
potent spear
potent spear
spring flax
potent spear
spring flax
#

@bot.command()
@commands.cooldown(1,20,commands.BucketType.member) 
async def test(ctx):
    await ctx.send('this is a test on_message command invokation')



@bot.listen()
async def on_message(message):
    ctx = await bot.get_context(message)
    if message.content == 'test':
        await ctx.invoke(bot.get_command('test'))
    else:
        return

the @commands.cooldown for the test command doesn't work, I guess doing ctx.invoke ignores cooldown how do I prevent this?

lucid tulip
#

๐Ÿ˜ณ

left dawn
#

Bruv

spring flax
#

just answer the question please lol

#

there's a reason

spring flax
slow fog
echo wasp
left dawn
#

If you really need to use on_message, either use @bot.event and then await bot.process_commands(), or use @bot.listen()
In this example, you DONT NEED to use on_message, as the default bot processes commands by default

cloud folio
#

Hello, what can I do about this error? TypeError: on_ready() missing 1 required positional argument: 'ctx'

spring flax
potent spear
cloud folio
echo wasp
left dawn
potent spear
spring flax
potent spear
gaunt ice
left dawn
#

Yes, remove on_message event and it'll work

spring flax
left dawn
#

Should work*

echo wasp
gaunt ice
#

@commands.cooldown(1,<cooldown seconds>,commands.BucketType.user)

nimble plume
#

Sniper stop take some rest

spring flax
gaunt ice
#

no

nimble plume
potent spear
spring flax
potent spear
#

I don't encourage spam, remove that

gaunt ice
#

try mine

nimble plume
#

Do discord have an auto spam or we need to make it

potent spear
gaunt ice
nimble plume
#

Ok..

left dawn
#

Discord bans some links by itself

echo wasp
nimble plume
#

we can use on_message event

potent spear
nimble plume
#

Do disnake support timeouts

echo wasp
nimble plume
#

As it is easy mute

potent spear
#

best thing I suggest you to do is OR have multiple folders for different bots
OR have all your variables in 1 env file

potent spear
nimble plume
#

Shit = True

potent spear
#

just some random extra variable

nimble plume
echo wasp
nimble plume
potent spear
nimble plume
echo wasp
#

is it a cog or same folder as the main file

potent spear
#

same folder

#

you can only import config the way I did if main.py and config.py are in the same folder

echo wasp
#

ok

potent spear
#

else you'd have to use another import notation, that's what relative imports are

nimble plume
#

Yes u can import variables

#

Nvmd

potent spear
#

you just import the whole file with all variables etc...

echo wasp
#

i did what you said todo

marble pilot
#

Hey everybody:) I started a discord bot using my own wrapper for nasa api, and i need somebody to just test out the 2 commands i have as of now and review it

#

i would be greatful

potent spear
# echo wasp

in the main file, you should
import config
then use any variable by
config.TOKEN or whatever

echo wasp
#

with the config file?

#

nvm

potent spear
echo wasp
#

just had to define it

#

is what i did

potent spear
#

that's useless and you know it

echo wasp
#

true

#

how do i make it so i don't have to hard code the help command?

slate swan
#

I mean, no hate, but if it is, your token isnt safe anyways

echo wasp
#

on linux

maiden fable
#

lmao

slate swan
echo wasp
maiden fable
#

she's kidding dw

slate swan
maiden fable
#

now i wish i never said that

nimble plume
#

except:
pass

slate swan
maiden fable
nimble plume
maiden fable
#

used to use that

nimble plume
# echo wasp

Imagine using a variable to get the variable of the config file

echo wasp
echo wasp
nimble plume
echo wasp
#

I told you that

#

I hate replit

nimble plume
echo wasp
#

And I mean light mode vs code

nimble plume
#

Light vs code is worst than a jumpscare

echo wasp
#

No

slate swan
nimble plume
#

imagine ur coding at night someone changed to light mode meanwhile : ๐Ÿ˜ต

echo wasp
#

It is 9 am dude

nimble plume
#

Its 10:35 pm here

#

searchs for people with same timezone

slate swan
#

def not me.

nimble plume
#

def

nimble plume
raven turret
#

I got a question, I created a server, added a bot and then suddenly I can't interact with any of my servers, e.g. if I right-click one of them, it just keeps loading forever, even after kicking the bot. (he had no abilities, 0 code) I also can't delete my server because when I want to go the ther server settings it just crashes

nimble plume
#

Toatally cursed

slate swan
nimble plume
marble pilot
slate swan
slate swan
marble pilot
#

who

nimble plume
#

no need of thanks.

slate swan
marble pilot
#

lmao good one

nimble plume
#

Mushrrom guy in chat

slate swan
#

lol

marble pilot
#

dyno guy in chat

slate swan
#

!ot in discord bot chat

nimble plume
#

Hello there

unkempt canyonBOT
marble pilot
nimble plume
#

await ctx.send("no ot guys")

slate swan
nimble plume
#

Cooking with alexa

raven turret
marble pilot
raven turret
#

fuu

#

but thx anyway

nimble plume
#

Toatally cursed by the bot

slate swan
nimble plume
slate swan
slate swan
raven turret
maiden fable
slate swan
slate swan
slate swan
#

xD

quick gust
maiden fable
#

!ot

unkempt canyonBOT
quick gust
#

๐Ÿ˜

maiden fable
#

you're welcome (:

nimble plume
#

Huh 2 pings

nimble plume
unkempt canyonBOT
nimble plume
#

not ot ยฏ\_(ใƒ„)_/ยฏ

slate swan
maiden fable
#

I know I am unique

sweet geyser
nimble plume
#

Ye

#

Im going to sleep nvmd bye all

sweet geyser
#

But yeah

dat = {'embeds': 
    [
        {
            'title': 'emoji []',
            'description': ':KekDoge:'
        }
    ]
}
#

I tried posting this in discord rest api

#

It gave me {'embeds': ['0']}

slate swan
#

and?

maiden fable
sweet geyser
#

For fun

#

I was bored

#

So started playing around rest api

maiden fable
#

ah cool

#

So what endpoint u sending that to

sweet geyser
#

Channel

#

channel/messages to be precise

slate swan
#

@sweet geyser @maiden fable this isnt the right channel

maiden fable
#

so the history?

neat pagoda
#

Anyone have a good hosting platform? our bot keeps having dataloss, it's not good especially since it's verified, dm me some solutions :/

slate swan
#

me

sweet geyser
neat pagoda
#

I already tried using replit

slate swan
#

no

maiden fable
neat pagoda
#

lol

maiden fable
slate swan
sweet geyser
maiden fable
#

It is related to the Discord API tho

maiden fable
neat pagoda
maiden fable
#

Anyways

#

@sweet geyser u wanted to get the channel's history?

sweet geyser
#

No not channel's history

maiden fable
#

Then

sweet geyser
#

I tried sending embed messages to a channel

#

But it failed

maiden fable
#

Ah create_message?

sweet geyser
#

{'embeds': ['0']}

sweet geyser
#
r = requests.post("https://discord.com/api/channels/channel.id/messages", headers=header, data=dat)
maiden fable
#

the embeds must be a list of Embed objects

sweet geyser
#

It is

maiden fable
#

Not 0

maiden fable
#

Okay

#

And is there an error?

sweet geyser
neat pagoda
maiden fable
#

Cool

maiden fable
sweet geyser
#

And when i tried .json()

#

{'embeds': ['0']}

maiden fable
#

Mind showing me the whole code after removing the token?

sweet geyser
#

This came up

quick gust
#

i wanna embed videos to embeds

maiden fable
#

Don't remove anything else except the token itself

sweet geyser
#

There are many unused imports since i changed stuff

maiden fable
#

Ignore the imports

#

I just want the header, dat dict and the function where u r calling the requests.post

sweet geyser
#
import requests
import json
import time

header = {"Authorization": "Bot <token>"}

r = requests.get("https://discord.com/api/guilds/920267012936754856", headers=header)
emj = []
for i in r.json()["emojis"]:
    if i["animated"]:
        emj.append("<a:" + i["name"] + ":" + i["id"] + ">")
    else:
        emj.append("<:" + i["name"] + ":" + i["id"] + ">")

dat = {
    'embeds': 
    [
        {
            'title': 'emoji []',
            'description': ':KekDoge:'
        }
    ]
}

r = requests.post("https://discord.com/api/channels/921665743797420063/messages", headers=header, data=dat)
print(r.json())
#

Here

maiden fable
#

and token is the original token, right?

sweet geyser
#

Yea

potent spear
#

why don't you use an existing API wrapper?

sweet geyser
#

Its not a self bot

potent spear
#

and...?

#

that's what makes it good to use existing api wrappers...

sweet geyser
#

Not like i am gonna make an entire api

maiden fable
#

first of all

#

your variable naming...

#

u have named both of them r

potent spear
sweet geyser
#

Nvm i am dumb as hell

maiden fable
#

Fixed it?

sweet geyser
#

Nope same issue

maiden fable
#

Then do one thing

#

Print the second request's JSON and show

sweet geyser
#

I removed the old request

#

Since i didn't use it

#

Yet the issue percists

#
dat = {
    'embeds': 
    [
        {
            'title': 'emoji []',
            'description': ':KekDoge:'
        }
    ]
}

re = requests.post("https://discord.com/api/channels/921365743797420063/messages", headers=header, data=dat)
print(re.json())
maiden fable
#

!d requests.post

unkempt canyonBOT
#

requests.post(url, data=None, json=None, **kwargs)```
Sends a POST request.
maiden fable
#

wait

#

try using the json arg

#

instead of the data

sweet geyser
#

Okay

#

It worked

maiden fable
#

nvm don't

#

Huh?

sweet geyser
#

It really did

maiden fable
#

Tf

#

That arg is meant for the JSON data but it works? Lmao

sweet geyser
#

i changed data= to json=

maiden fable
#

Hmm cool then

sweet geyser
#

Thanks a lot

maiden fable
#

Its been ages since I have used requests anyways

#

All cool

potent spear
#

you should also use the discord api version 9, since not specifying it will use v6, which is deprecated
https://discord.com/api/v{version_number}

quick gust
pliant gulch
#

Not possible with bots

quick gust
#

awh, alr

maiden fable
#

Thought so

#

BTW Andy

pliant gulch
#

The only type of embed you can send with a bot is RICH

maiden fable
#

Finished procrastinating?

pliant gulch
#

No

maiden fable
#

;-; why

quick gust
pliant gulch
# maiden fable ;-; why

Because last time I did a lot of stuff in one day my fingers died, Iโ€™m still recovering ๐Ÿ˜”

maiden fable
#

U do know that u have until the 28th of Feb to complete the wrapper with all the latest stuff, right? ๐Ÿ‘€

slate swan
#

Hey does anyone know a good library since discord.py is shutting down.

#

hikari

quick gust
#

!pypi disnake

unkempt canyonBOT
maiden fable
#

rin ๐Ÿ‘€

pliant gulch
quick gust
#

its not even done yet

maiden fable
quick gust
#

we should start suggesting once its done!

maiden fable
maiden fable
#

||u r correct tbh||

quick gust
#

:P

pliant gulch
#

โŒ

maiden fable
#

Why

pliant gulch
#

There is no way Iโ€™ll be done by then

maiden fable
#

I am sure Nova will be more than happy to help u complete the core of the lib ๐Ÿ‘€

pliant gulch
#

Not gonna let him

maiden fable
#

Why

manic wing
#

is there beef between andy and nova

#

who even is nova

maiden fable
#

Lmao they both working together bruv

maiden fable
manic wing
#

jeez there are 8 nova's

quick gust
#

this one

slate swan
#

only

maiden fable
quick gust
#

no nvm

maiden fable
#

Lmao

quick gust
#

this one lmao

maiden fable
#

Discord takes time to load members

pliant gulch
maiden fable
#

Lmao

pliant gulch
#

He wants to do voice receive but I want to!

#

Iโ€™m not letting him steal it

maiden fable
#

Either let him do voice receive or other core stuff

#

the choice is yours

pliant gulch
#

Neither

maiden fable
#

Or I will make PRs with my ugly code style ๐Ÿ‘€

pliant gulch
#

๐Ÿ‘๏ธ๐Ÿ‘„๐Ÿ‘๏ธ

spring flax
#

@pliant gulch mind helping with something?

pliant gulch
#

Might have time

spring flax
# pliant gulch Might have time

I have

@bot.event
async def on_message(message):
   ctx = await bot.get_context(message)
   if message.content == 'test':
       await ctx.invoke(bot.get_command('test'))
   else:
       return

This doesn't apply the cooldown to the command when test is written. How do i make it have the cooldown? I was told to do bot.invoke but I'm not sure how to

slate swan
spring flax
maiden fable
maiden fable
unkempt canyonBOT
maiden fable
#

Told u this too

spring flax
#

I don't think itll work

maiden fable
#

Imagine the code full of uwu's

maiden fable
slate swan
maiden fable
#

Idk about that

pliant gulch
spring flax
maiden fable
#

Yea but I just told u first to use is_on_cooldown and then use get_cooldown_retry_after if it is on cooldown

pliant gulch
#

Process commands will actually call the command properly with cooldowns

maiden fable
#

He wants to invoke a single command on mention iirc

pliant gulch
#

Instead of getting and invoking, just use that

spring flax
#

I can have it triggered with a normal message? Like test invoke ?test

pliant gulch
#

Whoops wrong reply

maiden fable
#

Haha

spring flax
#

I'm a bit confused here lol

shadow wraith
#

guys does anyone know why my bot does not send a message when i run a commmand

spring flax
#

mind giving an example?

echo wasp
#

Ok what is on channel create?

upbeat vapor
#

does anyone know basic python here?

echo wasp
#

on_channel.create????

shadow wraith
#

i don't have an on_message event

pliant gulch
#

@maiden fable Iโ€™m out of time so you should help, but really just slice the prefix off with string slicing

shadow wraith
maiden fable
slate swan
maiden fable
#

Lmao

spring flax
#

yeah, this is a python server, why'd anyone know python

maiden fable
#

U r rarely sarcastic

spring flax
#

hunter can ya help?

potent spear
slate swan
maiden fable
#

Sure, ig

echo wasp
#

where can i find all the def?

upbeat vapor
#

man

spring flax
#

let me explain what I want

maiden fable
slate swan
maiden fable
slate swan
maiden fable
#

U forgot ::

echo wasp
spring flax
# maiden fable Sure, ig

If I write test, I want it to invoke a command and the command checks and cooldown have applied to when that command is run

maiden fable
#

command_prefix=["", "?"]

shadow wraith
#
import disnake
from disnake.ext import commands

bot = commands.Bot(
    command_prefix="--", intents=disnake.Intents.all(), help_commmand=None
)


@bot.event
async def on_ready():
    print(bot.latency * 1000)


class coolHelpCommand(commands.MinimalHelpCommand):
    def __init__(self):
        super().__init__(no_category="Help")

    async def send_pages(self):
        destination = self.get_destination()
        for page in self.paginator.pages:
            Helpemby = disnake.Embed(description=f"{page}", color=0xCD08FF)
            await destination.send(embed=Helpemby)


bot.help_command = coolHelpCommand()


def loadShit():
    extensions = ["utility"]
    for i in extensions:
        bot.load_extension(i)


loadShit()


bot.run("token")

for some reason my bot doesnt send a message when i type --help

spring flax
#

that seems like a super bad idea

maiden fable
#

...?

#

Why tho

manic wing
#

tbh it doesnt seem like the best idea

spring flax
#

empty string as a prefix...

manic wing
#

you can just invoke a command with a context object via get_context

#

if its only certain words

maiden fable
#

I mean, u r just wasting extra resources to do the same thing as an empty string prefix would do

maiden fable
echo wasp
#

What is on channel create?

spring flax
maiden fable
#

!d discord.on_guild_channel_create

echo wasp
#

d!on channel create

unkempt canyonBOT
#

discord.on_guild_channel_delete(channel)``````py

discord.on_guild_channel_create(channel)```
Called whenever a guild channel is deleted or created.

Note that you can get the guild from [`guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.GuildChannel.guild "discord.abc.GuildChannel.guild").

This requires [`Intents.guilds`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.guilds "discord.Intents.guilds") to be enabled.
shadow wraith
#

i was tryna get help and someone told me to do that

maiden fable
#

weird

manic wing
#

and then use get_context

spring flax
#

yeah got that part

manic wing
#

and invoke

spring flax
#

get_context on what?

#

ah the message

slate swan
unkempt canyonBOT
#
Fat chance.

No documentation found for the requested symbol.

shadow wraith
#

this is my cog btw:

import disnake
import string, random
from disnake.ext import commands


class utility(commands.Cog, name="Utility"):
    def __init__(self, bot):
        self.bot = bot

    @commands.command()
    @commands.has_role("staff")
    @commands.guild_only()
    async def modnick(self, ctx, member: disnake.Member):
        new_nick = "Moderated Nickname "
        for i in range(5):
            new_nick += random.choice(string.punctuation)
        await member.edit(nick=new_nick)
        await ctx.send(
            f"Changed {member.mention}'s nick to `{new_nick}` | **{member.id}**"
        )
        new_nick = "Moderated Nickname "


def setup(bot):
    bot.add_cog(utility(bot))

th

maiden fable
#

!d discord.on_guild_channel_create is what u r looking for

unkempt canyonBOT
#

discord.on_guild_channel_delete(channel)``````py

discord.on_guild_channel_create(channel)```
Called whenever a guild channel is deleted or created.

Note that you can get the guild from [`guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.GuildChannel.guild "discord.abc.GuildChannel.guild").

This requires [`Intents.guilds`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.guilds "discord.Intents.guilds") to be enabled.
spring flax
#

await bot.get_context(message)
but what does this do and how does it invoke a specific command? @manic wing

shadow wraith
manic wing
#

ctx = await bot.get_context(message) and then you would do await ctx.invoke(command) where command is the instance of your comand

shadow wraith
#

this is what i got lmfao

shadow wraith
#

it just doesnt send messag

slate swan
#

Caeden drunk

maiden fable
#

DUDE I have send the docs for channel create like 3 times now

slate swan
#

guild_channel

spring flax
maiden fable
#

!d discord.on_guild_channel_create

unkempt canyonBOT
#

discord.on_guild_channel_delete(channel)``````py

discord.on_guild_channel_create(channel)```
Called whenever a guild channel is deleted or created.

Note that you can get the guild from [`guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.GuildChannel.guild "discord.abc.GuildChannel.guild").

This requires [`Intents.guilds`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.guilds "discord.Intents.guilds") to be enabled.
manic wing
slate swan
maiden fable
#

!d discord.ext.commands.MinimalHelpCommand.send_pages

unkempt canyonBOT
#

await send_pages()```
A helper utility to send the page output from [`paginator`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.MinimalHelpCommand.paginator "discord.ext.commands.MinimalHelpCommand.paginator") to the destination.
maiden fable
#

DUDE

spring flax
#

i was told to use bot.invoke

maiden fable
#

!d discord.on_guild_channel_update

unkempt canyonBOT
#

discord.on_guild_channel_update(before, after)```
Called whenever a guild channel is updated. e.g. changed name, topic, permissions.

This requires [`Intents.guilds`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.guilds "discord.Intents.guilds") to be enabled.
maiden fable
#

ARGHHHHHHHHHHHH WHY U DOING THIS

manic wing
#

hunter stop spamming

#

im tryna piss you off darling

slate swan
#

Caeden.exe is corrupted

shadow wraith
slate swan
manic wing
#

yeah hunter, stop moaning just help

maiden fable
maiden fable
shadow wraith
echo wasp
#

I don't think i am doing this right py @commands.Cog.listener() async def on_guild_channel_create(self,ctx): ctx.channel.send('place holder')

maiden fable
#

I am already sleepy, please don't piss me off

manic wing
spring flax
manic wing
maiden fable
manic wing
#

await

slate swan
maiden fable
#

Take me with youuu

manic wing
shadow wraith
manic wing
#

ps you await

manic wing
#

its a channel being created

echo wasp
manic wing
#

tf is the before gonna be

manic wing
echo wasp
manic wing
#

thats what theyre there for

echo wasp
manic wing
#

discord.on_guild_channel_delete(channel)

#

it means it passes channel

echo wasp
#

ok do i pass it ctx or do i just pass self and channel

manic wing
#

self, channel

#

because it takes channel; not ctx

#

think about it, where would ctx come from? no command is being invoked...

#

so you would do await channel.send('wow...')

echo wasp
#

right

#

thank you

slate swan
#

Can someone tell what's is different between guild.fatch_ban() and guild.bans()

hardy wing
manic wing
#

just bumping this

slate swan
manic wing
#

its fetch dude

spring flax
hardy wing
spring flax
# manic wing *just bumping this*
async def help(ctx, command_name):
  command = bot.get_command(command_name)
  if command:
    #command eists
  else:
    #command doesn't exist
hardy wing
#

frick

manic wing
echo wasp
#
@commands.Cog.listener()
    async def on_guild_channel_create(self, channel):
        em = discord.Embed(title = 'Ticket Format' description = 'This is the ticket format' \n 'Username: (Your Roblox User)' \n 'Claiming: (What your claiming)' \n 'Invites: (Number of invites that you are using)' \n 'Proof: (Your invite count using -invites)')
        await channel.send(embed= Em)``` invaild syntax
maiden fable
#

u forgot commas and the \n isn't inside the quotes

echo wasp
quick gust
#

after every kwarg...

echo wasp
#

nope i fixed it

rigid island
#

To convert matplotlib objects(py module which give graph) and display them as discord embeds in jpeg form

#

how can i do that ?

fluid spindle
#

Are there any changes that I have to make to write slash commands?

slate swan
#

what library?

fluid spindle
#

disnake

slate swan
#

If it's Disnake just updating it will make the code which now shows error work again

#

pip install -U disnake

fluid spindle
fluid spindle
echo wasp
#

How would i make a command for my bot so if i ran the command it would send a message though a webhook of what i just typed? like for say &webhook Hello there this is a test message and it sends it though the webhook to what ever server it is

slate swan
echo wasp
#

that why i don't use slash commands

fluid spindle
#

I don't wanna use them too

echo wasp
slate swan
split plover
#

how can i simply let my bot delete a command response if the command is used a 2nd time? so the command is used - response from bot - command is used 2nd time - 2nd response and deletes 1st response

echo wasp
echo wasp
fluid spindle
# echo wasp then don't

But there's this thing for which I have to use Modals for, and as far as I understand from reading the disnake Github they only work with slash commands.

slate swan
#

not true, modals can be used normally too

#

By adding it into a view

slate swan
echo wasp
maiden fable
#

Imagine dpy with this type of code quality

rigid island
echo wasp