#discord-bots

1 messages Β· Page 492 of 1

vast gale
#

perhaps that is slightly larger than 8mb

slate swan
#

would it do 2 power 10 power 2 times 8 ?

vast gale
#

yeah

slate swan
#

waiting for danny to change his mind and finally adds slash commands πŸ˜” 9acosp_sonicwaiting

hasty iron
#

he most likely wont

#

and adding slash commands is a simple task

slate swan
#

i dont think he would , i saw a work that had it

hasty iron
#

all the http endpoints are already implemented in 2.0 for slash commands

#

so all you have to do is add the classes and stuff

vast gale
#

okay how would I get the correct size of 8mb

pliant gulch
#

What were you trying to send?

#

Depending on what you were trying to send you could prob compress it or do some other thing to get it under 8mb

vast gale
#

a file that can be maxxed out at that size, but I set the size of the file

pliant gulch
#

if you set the size of the file try setting it lower then what you had earlier

#

Since what you had was a bit over 8mb

dusk pumice
#

How aboit tring
await ctx.send(files=discord.files('your file dir')
I hope it works. if not i'm so sorry.

pliant gulch
#

I'd guess for some reason it adds a few megabits

dusk pumice
#

or how's using google cloud?

vast gale
#

nah, i just need to set the file to a little smaller

#

so basically I'm asking what is the size of 8mb lol

#

its either 1024 or 1000 kb but discord has never anwered which they use

dusk pumice
#

umm ok

pliant gulch
#

well if they didn't answer it won't be hard to check it for yourself

#

Theres only two choices so, just do trial and error see which works ig

dusk pumice
#

Hmm.. I guess andy's right.

vast gale
#

well

#

i found something

#

somehow this file is bigger than what discord allows??

#

(this server does not have 50mb per user)

pliant gulch
#

Seems like discord is inconsistent

#

Not surprising

little ether
#

that's because mod,reason,timeand warn_id contain lists

slate swan
#

what do i do with the embed if its giving me this error?

@client.event
async def on_message(message):
  if str(message.channel.type) == "private":
    modmail_channel = discord.utils.get(client.get_all_channels(), name="modmail")
    embed = discord.Embed(
      color=0xffffff,
      timestamp=datetime.utcnow()
    )
    embed.add_field(name="Modmail", value=message.content)
    embed.set_author(name=str(message.author))
    embed.set_thumbnail(url=str(message.author.avatar_url))
    embed.set_footer(text=f"ID: {message.author.id}")
    await modmail_channel.send(embed=embed)
  elif str(message.channel) == "modmail" and message.content.startswith("<"):
    member_object = message.mentions[0]

    index = message.content.index(" ")
    string = message.content
    mod_message = string[index:]

    embed = discord.Embed(
      color=0xffffff,
      timestamp=datetime.utcnow()
    )
    embed.add_field(name="Modmail", value=mod_message)
    embed.set_author(name=message.author.display_name + " " + "(" + str(message.author) + ")", icon_url=message.author.avatar_url)
    embed.set_thumbnail(url=str(message.guild.icon_url))
    await member_object.send(embed=embed)
little ether
#

you could do

warns = users[f'{user.id}']['warns']
moderator = users[f'{user.id}']['mod'][0]
warn_reason = users[f'{user.id}']['reason'][0]
warn_time = users[f'{user.id}']['time'][0]
warn_id = users[f'{user.id}']['warn_id'][0]
slate swan
#

what host platform do you recommend?

static anchor
#

so

#

how do I make it so the bot's status will change (python code)

little ether
#

oh yeah sorry you don't need the [0] on the warns because its already just an int warns = users[f'{user.id}']['warns']

#

yes, leave the warns as they are before, i overlooked that

#

no, the same as before

tribal sundial
#

hi guys

#

i've set up a bot that on command goes to a specific voice channel (specified by channel id) and plays an audio file

#

how would i make it go to a different voice channel if

#

the command was used in a specific text channel (defined by id)

little ether
#

ah, you want to do that

@bot.command()
@commands.has_permissions(administrator=True)
async def warnings(ctx, user:nextcord.Member):
    with open('warns.json', 'r') as f:
        users = json.load(f)

    warns = users[f'{user.id}']['warns']
    moderator = users[f'{user.id}']['mod']
    warn_reason = users[f'{user.id}']['reason']
    warn_time = users[f'{user.id}']['time']
    warn_id = users[f'{user.id}']['warn_id']


    await ctx.send(f"Warning count: {warns} Given by:{', '.join(moderator)} For:{', '.join(warn_reason)}At:{', '.join(warn_time)} IDs:{', '.join(warn_id)}")

this should work

#

!d str.join and if your wondering what's up with the ''.joins

unkempt canyonBOT
#

str.join(iterable)```
Return a string which is the concatenation of the strings in *iterable*. A [`TypeError`](https://docs.python.org/3.10/library/exceptions.html#TypeError "TypeError") will be raised if there are any non-string values in *iterable*, including [`bytes`](https://docs.python.org/3.10/library/stdtypes.html#bytes "bytes") objects. The separator between elements is the string providing this method.
tribal sundial
#

can anyone help me?

little ether
#

ah,

await ctx.send(f"Warning count: {warns} Given by:{', '.join(str(mod) for mod in moderator)} For:{', '.join(warn_reason)}At:{', '.join(warn_time)} IDs:{', '.join(str(wrn_id) for wrn_id in warn_id)}")

i forgot you need to convert all values inside the list to strs

#

np, sorry if the help i gave was subpar

hasty iron
#

well yes you shouldn’t

tribal sundial
#

hi guys
i've set up a bot that on command goes to a specific voice channel (specified by channel id) and plays an audio file
how would i make it go to a different voice channel if
the command was used in a specific text channel (defined by id)?

outer violet
#

I got my modmail system to finally work but now none of my commands are working and there’s no error

unkempt canyonBOT
#

Hey @outer violet!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

β€’ If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

β€’ If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

outer violet
little ether
slim linden
#

how to see all permission a role has

little ether
unkempt canyonBOT
vagrant galleon
#

is it possible to dm someone a webhook in discord.py?

wicked atlas
urban sphinx
#

await client.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name="Your every move!"))

vagrant galleon
urban sphinx
#

webhooks are

#

uh

#

unique to 1 server

#

idk how to word it

vagrant galleon
#

how would i send an embed *

#

i worded it wrong

gloomy coral
#

GUYS

#

I NEED HELP ASAP

#

so my discord bot got verified

urban sphinx
gloomy coral
#

but intents have a problem

wicked atlas
urban sphinx
#

its easier in my opinion

vagrant galleon
gloomy coral
urban sphinx
#

OOOOOOOOOOOOH

wicked atlas
#

Sending a message to a user has the same parameters as to a DM

gloomy coral
#

It is showing intent error

urban sphinx
#

intents = discord.Intents.all()

gloomy coral
#
File "/root/chad/bot.py", line 273, in <module>
bot.run(token)
File "/usr/local/lib/python3.8/dist-packages/discord/client.py", line 723, in run
return future.result()
File "/usr/local/lib/python3.8/dist-packages/discord/client.py", line 702, in runner
await self.start(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/discord/client.py", line 666, in start
await self.connect(reconnect=reconnect)
File "/usr/local/lib/python3.8/dist-packages/discord/client.py", line 601, in connect
raise PrivilegedIntentsRequired(exc.shard_id) from None
discord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead.```
wicked atlas
#

You can send it using the member.send method

urban sphinx
#

intents = discord.Intents.all()

vagrant galleon
#

embed = DiscordEmbed(title='test', description=f'test', color='0x548dff')

gloomy coral
#

i did tht

vagrant galleon
#

i need em to dm that

urban sphinx
#

enable intents in your bot

wicked atlas
gloomy coral
#

@urban sphinx it shows

urban sphinx
gloomy coral
#

yeah i got the member intent

urban sphinx
#

enable the intents

gloomy coral
#

its verified

urban sphinx
#

hm.

#

your bots

#

is in 100+ servers?

gloomy coral
#

i cant enable all, how can i only enable serve intent

gloomy coral
vagrant galleon
urban sphinx
#

if its in 100+ you need to get it verified

wicked atlas
#

!d discord.Intents

unkempt canyonBOT
#

class discord.Intents(**kwargs)```
Wraps up a Discord gateway intent flag.

Similar to [`Permissions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions "discord.Permissions"), the properties provided are two way. You can set and retrieve individual bits using the properties as if they were regular bools.

To construct an object you can pass keyword arguments denoting the flags to enable or disable.

This is used to disable certain gateway features that are unnecessary to run your bot. To make use of this, it is passed to the `intents` keyword argument of [`Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client").

New in version 1.5...
gloomy coral
#

But for now i rlly need help

urban sphinx
#

you need to send discord your id

wicked atlas
gloomy coral
#

IT got verified

urban sphinx
#

oh

gloomy coral
#

Today

urban sphinx
#

hmmmmm

#

send ss

vagrant galleon
#

@urban sphinx help.

wicked atlas
#

perhaps this?

#

or no

urban sphinx
#

hm

wicked atlas
#

no not that

urban sphinx
#

thats only server intents

wicked atlas
#
discord.Intents(guilds=True)
gloomy coral
#

So what all intents do i need?

urban sphinx
#

discord.Intents.all() usually works

wicked atlas
gloomy coral
#

but it doesnt cuz i dont have prescence

urban sphinx
#

or discord.Intents.default()

gloomy coral
#

i tried that

#

but then he is online

urban sphinx
#

who

gloomy coral
#

but member intents arent working

#

the bot

#

it shows 1 member in 250 servers

vagrant galleon
#

Command raised an exception: AttributeError: 'DiscordEmbed' object has no attribute 'to_dict'
got that error when i tried
await ctx.author.send(embed = DiscordEmbed(title='test', description=f'test', color='0x548dff'))

urban sphinx
#

its

#

discord.Embed

gloomy coral
#

Dude i need help asap

wicked atlas
gloomy coral
#

i have an exam at 8 15

#

and wanna fix the bot be4 tht

#

Please help me

vagrant galleon
urban sphinx
#

embed = discord.Embed()
embed.title = "bla bla bla"
embed.description = "etc etc"

#

await ctx.send(embed=embed)

wicked atlas
vagrant galleon
#

but how do i set the color in this version, cuz the 0x548dff got an error

wicked atlas
urban sphinx
#

you can try doing

wicked atlas
#

!d discord.Colour

urban sphinx
#

discord.Colour

unkempt canyonBOT
#

class discord.Colour(value)```
Represents a Discord role colour. This class is similar to a (red, green, blue) [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.9)").

There is an alias for this called Color...
vagrant galleon
#

where i put that doe

urban sphinx
#

embed.color = discord.Colour

wicked atlas
#

Use one of these methods

#

For example, red```py
embed.color = discord.Colour.red()

urban sphinx
#
emb = discord.Embed(title = "Giveaway!", description = f"{prize}", color = discord.Colour.blue())
    emb.add_field(name = "Ends at:", value = f"{answers[1]}")
    emb.set_footer(icon_url=ctx.author.avatar_url,text=ctx.author.name)
    bruh = await channel.send(embed = emb)
#

stole this from my giveaways command

vagrant galleon
#

await ctx.author.send(embed = DiscordEmbed(title='test', description=f'test', discord.Colour.red()))

urban sphinx
#

no no

vagrant galleon
#

like that?

urban sphinx
#

await ctx.author.send(embed = DiscordEmbed(title='test', description=f'test', color = discord.Colour.red()))

#

do you want to send it

#

to a dm?

vagrant galleon
#

yes

urban sphinx
#

oh okay

vagrant galleon
#

how do i make it send the timestamp with it

urban sphinx
#

uhm

#

datetime

vagrant galleon
#

this worked for the server one, but how i implement it into the dm

wicked atlas
#

What is the timestamp for?

#

What event is it showing the time of?

sage otter
#

Its literally the same thing. embed objects work the same way being sent anywhere.

vagrant galleon
#

looks pretty

vagrant galleon
wicked atlas
sage otter
#

Build the embed the same way you built it when you were sending it in a guild

vagrant galleon
#

this isnt not the same way

sage otter
#

webhooks??

#

Isnt that a guild only thing?

vagrant galleon
#

yeah im using webhooks for the server but im tryna dm the embed to somenoe

wicked atlas
#

Why are you using webhooks for sending one thing, and the bot for dms? Why not just use the bot for both?

vagrant galleon
sage otter
#

discord.User.send(embed=embed)

urban sphinx
#

he wants to send it to the author

vagrant galleon
#

await ctx.author.send(embed = discord.Embed(title='test', description=f'test', color = discord.Color.green())) guys this works just fine

#

all i gotta know is how to add the timestamp

#

to that

urban sphinx
#

timestamp()

vagrant galleon
#

just add a comma? then timestamp()?

sage otter
urban sphinx
#

i think yeah

wicked atlas
urban sphinx
sage otter
#

I mean

#

object wise

wicked atlas
#

It's a discord.Member object I think

sage otter
#

its both User and Member

#

it depends where the current context is.

#

If not in a guild its a User object

wicked atlas
#

discord.abc.User

vagrant galleon
#

its just in a priv server with like 5 people

vagrant galleon
urban sphinx
#

can someone send me a list of discord scam links

vagrant galleon
#
    dm_embed.set_timestamp()
    await ctx.author.send(embed = dm_embed)```
#

that didnt work

wicked atlas
#

What code are you using for your webhook?

#

I see you using this DiscordEmbed object that I don't recognize

sage otter
#

you dont use a method to set it

vagrant galleon
#
    embed = DiscordEmbed(title='a', description=f'a', color='0x548dff')
    embed.set_author(name="a")
 
    embed.set_timestamp()
    webhook.add_embed(embed)
    webhook.execute()```
vagrant galleon
#

and it works just fine

#

from discord_webhook import DiscordWebhook, DiscordEmbed

sage otter
#

oh, its a third party lib.

vagrant galleon
#

oh

#

idk it works fine

wicked atlas
#

Rip, yeah I would re-write that to use discord.py as well

sage otter
#

Idk then

vagrant galleon
#

😦

sage otter
#

Just read the docs for that lib then.

vagrant galleon
#

i cba to re write it just for a timestamp

vagrant galleon
wicked atlas
#

But looking at the docs for discord_webhook, you should be able to just do

from datetime import datetime
embed.timestamp = datetime.now()
vagrant galleon
drifting arrow
#

What are webhooks and why do I want to use them?

drifting arrow
#

never used a webhook before lol

drifting arrow
#

noo

#

Nelly the hamster can't really use webhooks ;-;

wicked atlas
# vagrant galleon

Which does this, it looks like

    def set_timestamp(self, timestamp=None):
        """
        set timestamp of embed content
        :param timestamp: (optional) timestamp of embed content
        """
        if timestamp is None:
            timestamp = time.time()
        self.timestamp = str(datetime.datetime.utcfromtimestamp(timestamp))
vagrant galleon
drifting arrow
#

never not have timestamps

wicked atlas
vagrant galleon
sage otter
sage otter
#

you said you're using discord.Embed() and not the DiscordEmbed() from that 3rd party lib

vagrant galleon
#

ye

sage otter
#

So just

wicked atlas
vagrant galleon
#

i literally said it worked??

wicked atlas
#

Try this then

from datetime import datetime
embed.timestamp = datetime.utcnow()
vagrant galleon
drifting arrow
sage otter
#

makes sense

drifting arrow
#

What? wasn't like you were sitting here not contributing.

#

Geesh. learn to not contribute so you can take credit.

unkempt canyonBOT
#

@glad leaf Please don't try to ping @everyone or @here. Your message has been removed. If you believe this was a mistake, please let staff know!

drifting arrow
#

What's a cool bot thing I could do? πŸ€”

#

is statistics a reserved word?

sage otter
#

no, its not.

drifting arrow
#

Then why is it coming up blue ;-;

sage otter
#

You could easily check things you know, if you have a linter or if whatever you're writing in has syntax highlighting.

drifting arrow
#

is it a reserved word in sql? πŸ€”

sage otter
#

Because you're in a string.

drifting arrow
sage otter
#

thats interesting then.

drifting arrow
#

not a reserved word

#

Β―_(ツ)_/Β―

#

lets run my code nad find out

#

No errors

trim barn
#
                    for y in ["βœ…", "❌"]:
                        await confirm_embed.add_reaction(str(y))

                    def reaction_check(rctn, usr):
                        return usr.id == ctx.author.id and str(rctn) == 'βœ…' or str(rctn) == '❌'

                    rctn, usr = await self.client.wait_for("reaction_add", check=reaction_check)

can someone check if I'm doing this right?

drifting arrow
trim barn
sage otter
#

can you send full code pls.

#

Wondering if you actually put any logic in for that or if you're just sending regardless.

unkempt canyonBOT
#

Hey @trim barn!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

β€’ If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

β€’ If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

trim barn
#

one sec lemme get a haste

wicked atlas
#

I feel like the error might be in the logic here

return usr.id == ctx.author.id and str(rctn) == 'βœ…' or str(rctn) == '❌'
#

Might want to add some ()

return usr.id == ctx.author.id and (str(rctn) == 'βœ…' or str(rctn) == '❌')
trim barn
#

That's what I figured

#

alright

#

time to test

lyric moat
#

why this keep spamming

trim barn
#

That was the error

trim barn
#

try going into taskbar and closing them

drifting arrow
trim barn
#

well I use Pycharm so i wouldn't know

#

maybe using atom and hit run one too many times

drifting arrow
#

Nothing else to do.. Time to i guess update my bot to stop using csv and json files lol

#

Yeah. im gonna need to rewrite this entire thing ;-;

drifting arrow
#

I'm using aiosqlite

steep estuary
#

pls tell me some good discord bot host :)

#

i was using heroku πŸ˜… cuz i used it before also

river walrus
steep estuary
#

but its free dynos are over

#

yes

#

i just wanted to see logs

river walrus
#

I'll fetch you the list

steep estuary
#

that's why i used and also i don't know any other good host

steep estuary
#

so i am finding new host

river walrus
#

Need to run your bot 24/7? Get a cheap VPS.
https://www.scaleway.com/ EU https://www.linode.com/ US/EU/Asia
https://www.digitalocean.com/ US https://www.vultr.com/ US
https://www.ovh.co.uk/ EU/Canada https://www.hetzner.com/ Germany
https://www.time4vps.eu/ Lithuania.
Self-hosting: Free hosting: Kinda free:
Any computer. No. Not even heroku. GCP, AWS have one year free micros.

Linode

Our mission is to accelerate innovation by making cloud computing simple, affordable, and accessible to all.

Vultr

Vultr Global Cloud Hosting - Brilliantly Fast SSD VPS Cloud Servers. 100% KVM Virtualization

steep estuary
#

is it free πŸ˜…

river walrus
steep estuary
#

but i can never use a paid option 😞

river walrus
steep estuary
#

??

river walrus
#

Run it on your own PC

steep estuary
#

but i cannot keep my pc 24/7 on :/

dapper cobalt
steep estuary
#

-_-

dapper cobalt
lyric moat
#

how to make as your bot joins a server it sends an text in the first channel it sees

steep estuary
#

yes

#

but free option πŸ˜₯

#

i used heroku free dynos for 1 month

dapper cobalt
#

In my own opinion, if your bot isn't very large. And I'm speaking about very large numbers, like 10,000+ servers. A VPS would be just a waste of money.

#

Especially when it's written in Python, as Python uses so much less resources than Node.js and a few other languages.

lyric moat
#

how to make as your bot joins a server it sends an text in the first channel it sees

unkempt canyonBOT
#

discord.on_guild_join(guild)```
Called when a [`Guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild "discord.Guild") is either created by the [`Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") or when the [`Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") joins a guild.

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

replit?

hardy yoke
#

yh

slate swan
slate swan
lyric moat
# slate swan !d discord.on_guild_join

could this work?

@client.event
async def on_guild_join(guild):
    try:
        joinchannel = guild.system_channel
        # The system channel is where Discord’s join messages are sent
        await joinchannel.send('Thanks for inviting me to your server!')
    catch:
        # if no system channel is found send to the first channel in guild
        await guild.text_channels[0].send(<message>)```
slate swan
#

yeah it will

#

replace catch with except tho

#

guys, id like to learn more about self hosting

dry copper
#

um i am starting making music bot using python kindly help

slate swan
#

how do big self hosted bots keep being online

#

all day?

slate swan
#

virtual private server

dry copper
slate swan
#

!ytdl

unkempt canyonBOT
#

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

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

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

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

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

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

oof

lyric moat
slate swan
lyric moat
#

can i make like it make it own channel?

#

@slate swan

fleet axle
#

hey how to give this role to my bot this role is managed by integration. This role cannot be given to users

spring flax
#

Upon inviting a bot it gets a role managed by integration

boreal ravine
boreal ravine
#

Meaning it's automatically given to boosters, bots

fleet axle
#

yeah

hardy yoke
#

Unless you have an alternative to offer it is

lyric moat
#

how can i make it send an embed instead of words?

send(Test)```
fleet axle
#

Like my bot is not getting that role

boreal ravine
fleet axle
#

I want my bot to get that role

boreal ravine
#

wait wrong

hardy yoke
#

πŸ†—

boreal ravine
lyric moat
#

huh?

slate swan
boreal ravine
fleet axle
#

when joined a server my bot is not getting that role

boreal ravine
#

Show your bots role

fleet axle
#

like wait

slate swan
#

!d discord.Guild.create_text_channel @lyric moat here

unkempt canyonBOT
#

await create_text_channel(name, *, reason=None, category=None, position=..., topic=..., slowmode_delay=..., nsfw=..., overwrites=...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

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

Note that you need the [`manage_channels`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_channels "discord.Permissions.manage_channels") permission to create the channel.

The `overwrites` parameter can be used to create a β€˜secret’ channel upon creation. This parameter expects a [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.9)") of overwrites with the target (either a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") or a [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role")) as the key and a [`PermissionOverwrite`](https://discordpy.readthedocs.io/en/master/api.html#discord.PermissionOverwrite "discord.PermissionOverwrite") as the value.

Note

Creating a channel of a specified position will not update the position of other channels to follow suit. A follow-up call to [`edit()`](https://discordpy.readthedocs.io/en/master/api.html#discord.TextChannel.edit "discord.TextChannel.edit") will be required to update the position of the channel in the channel list...
boreal ravine
#

Kk

fleet axle
#

There is dyno bot when the bot joins a server it will automatically creates a with its name and assign itself

fleet axle
#

I want this to do for my bot

boreal ravine
#

dude

#

you automatically get it

fleet axle
boreal ravine
fleet axle
#

the bot is in many servers

lyric moat
boreal ravine
lyric moat
#

to py .send(Test)?

boreal ravine
#

.send(embed=var_name)

slate swan
lyric moat
#

@boreal ravine

boreal ravine
#

the one where you defined what your embed variable is

lyric moat
#

@boreal ravine

boreal ravine
vast spindle
#

if not 'https://' in message.content.lower: what is wrong with this?

lyric moat
#

why does the color does not work

#
color=0x2f3136"))```
boreal ravine
#

You should read the error lol

lyric moat
#

i added f"

#

how i fix it?

wispy spade
vast spindle
boreal ravine
#

:/

dapper cobalt
#

When the bot is added with 0 permissions, it doesn't get a role, even if it got a role with administrator permissions later on. It will have to be added to the server with the administrator permissions.

boreal ravine
#

!d discord.ActivityType

unkempt canyonBOT
#

class discord.ActivityType```
Specifies the type of [`Activity`](https://discordpy.readthedocs.io/en/master/api.html#discord.Activity "discord.Activity"). This is used to check how to interpret the activity itself.
lyric moat
dapper cobalt
slate swan
dapper cobalt
#

I suggest you learn Python's basics before touching discord.py.

lyric moat
#

nvm nvm

#

i found out

#

why it gives an error?

  File "main.py", line 41
    except:
    ^
SyntaxError: invalid syntax```
boreal ravine
#

Use a third party lib

boreal ravine
boreal ravine
lyric moat
#

i did

lyric moat
#
    except:
        # if no system channel is found send to the first channel in guild
        await guild.text_channels[0].send(test)```
boreal ravine
valid galleon
#

it's not a good idea to copy paste code

boreal ravine
#

!d discord.Embed

unkempt canyonBOT
#

class discord.Embed(*, colour=Embed.Empty, color=Embed.Empty, title=Embed.Empty, type='rich', url=Embed.Empty, description=Embed.Empty, timestamp=None)```
Represents a Discord embed.

len(x) Returns the total size of the embed. Useful for checking if it’s within the 6000 character limit.

bool(b) Returns whether the embed has any data set.

New in version 2.0.

Certain properties return an `EmbedProxy`, a type that acts similar to a regular [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.9)") except using dotted access, e.g. `embed.author.icon_url`. If the attribute is invalid or empty, then a special sentinel value is returned, [`Embed.Empty`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed.Empty "discord.Embed.Empty").

For ease of use, all parameters that expect a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") are implicitly casted to [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") for you.
sweet merlin
#

AttributeError: 'TextChannel' object has no attribute 'add_reaction

code:
await channel.add_reaction(':white_check_mark:')

#

any help?

boreal ravine
#

Did u install it though?

#

!discord-together

sweet merlin
#

u dont have the package

#

lib*

boreal ravine
#

Maybe because you didn't install the module yet..?

sweet merlin
#

might be, or maybe you type it wrong?

boreal ravine
#

bruh

#

its discord-together

sweet merlin
#

read the documentary

#

i remember when i install a lib, the package name is different when i import it

boreal ravine
#
from discord.ext import commands
from discordTogether import DiscordTogether

client = commands.Bot(command_prefix="~")
togetherControl = DiscordTogether(client)

@client.command()
async def startYT(ctx):
    link = await togetherControl.create_link(ctx.author.voice.channel.id, 'youtube')
    await ctx.send(f"Click the blue link!\n{link}")

client.run("BOT_TOKEN_HERE")
#

Did you try that?

hardy yoke
boreal ravine
#

Did u install it though?

#

You're using replit. Try going to the package menu

#

And search discord-together

sweet merlin
ember sorrel
boreal ravine
#

..

#

Still do it.

ember sorrel
sweet merlin
#

what is that !?!

hardy yoke
sweet merlin
#

AttributeError: 'TextChannel' object has no attribute 'message'

boreal ravine
#

@slate swan try it pls

sweet merlin
#

code: await channel.message.add_reaction(':white_check_mark:')

boreal ravine
#

see? :)

ember sorrel
#

you need a specific message, a channel does not have only 1 message @sweet merlin

boreal ravine
unkempt canyonBOT
#
Fat chance.

No documentation found for the requested symbol.

hardy yoke
#

reply uses poetry internally. Poetry installs into its own venv. Trying to add stuff via pip doesn't always work on repl

sweet merlin
#

!d discord.TextChannel

unkempt canyonBOT
#

class discord.TextChannel```
Represents a Discord guild text channel.

x == y Checks if two channels are equal.

x != y Checks if two channels are not equal.

hash(x) Returns the channel’s hash.

str(x) Returns the channel’s name.
boreal ravine
#

np

valid galleon
#

Its best not to use replit. it isnt made for discord bots. use an actual editor/IDE like VSCode or pycharm

novel rampart
#

yes

sweet merlin
novel rampart
#

way

#

the replit is not good

ember sorrel
sweet merlin
ember sorrel
#

here itself

sweet merlin
#
    @commands.Cog.listener()
    async def on_message(self, message):
      if message.author.bot:
       return
      else:
        channel = self.bot.get_channel(884996199629860864)
        await channel.message.add_reaction('βœ…')
        await channel.message.add_reaction('❎')```
valid galleon
#

IDE's can run code too. If you wanna host it 24/7, use something like heroku(again, heroku isnt made for discord bots, but its free) if you want something better, use a VPS. it costs like 2$ a month

ember sorrel
sweet merlin
novel rampart
valid galleon
valid galleon
ember sorrel
#

hold up

novel rampart
#

hmmm

sweet merlin
boreal ravine
#

ratelimiting

sweet merlin
#

yeah its gonna react to all channel

valid galleon
sweet merlin
wispy spade
valid galleon
wispy spade
#

at least it should

stark hearth
#

what is a good and cheap vps?

ember sorrel
sweet merlin
hardy yoke
#

he's using an on_message events

sweet merlin
#

like a poll channel

hardy yoke
#

presumably he wants every message in that channel reacted to

wispy spade
ember sorrel
wispy spade
#

you would have to check if the message's channel is equal to the one you want to react to

sweet merlin
sweet merlin
wispy spade
ember sorrel
sweet merlin
#

alright

wispy spade
sweet merlin
#

aight its working! thanks guys!!!

boreal ravine
sweet merlin
valid galleon
#

np it was just a joke

outer violet
#

so im trying to make it so whenever a user dms the bot, it responds back with "this message has been sent to staff" or like in embed form or something but idk where i would put it in my code which is this currently https://hastebin.com/awexefahoh.properties

#

can someone help?

ocean leaf
#

do anyone know how to fix this error?

#

it is comming from here

fading harness
#

hi

#

how can i register slash command

#

in cogs

sweet merlin
keen talon
sweet merlin
outer violet
sweet merlin
gloomy quest
#

hi

#

how to add emojis

#

in embeds

sweet merlin
#

<:emoji:>

gloomy quest
#

ooo thx

sweet merlin
boreal ravine
#

Then copy it into the embed

gloomy quest
#

ohk

sweet merlin
#

not custom emoji:
\:emoji: copy it and paste
example:
\❎

custom emoji:
u get the code first \:emoji: copy it
then use it example: !ducky_hunt

boreal ravine
sweet merlin
#

on replit*

boreal ravine
#

If its a browser emoji it'll change to that

boreal ravine
#

\❎

sweet merlin
#

the x thing

sweet merlin
outer violet
#

message

boreal ravine
#

why is there ctx.channel then?

#

use message.channel to replace that

sweet merlin
boreal ravine
sweet merlin
boreal ravine
#

He gave that, you'll change it

sweet merlin
#

my bad

boreal ravine
#

If it's an event change it to the correct params

outer violet
#

okay it works now

#

how do i get it to only send it once and not every time someone sends a message?

tiny ibex
#

Is there a way you can make your own vc games or whatever they are called

sweet merlin
outer violet
tiny ibex
#

Chess already exists so something else like that

sweet merlin
#

because if you bot goes down/off/logged off it will be reset

outer violet
tiny ibex
sweet merlin
outer violet
tiny ibex
#

Please

sweet merlin
#

it will loks like that

outer violet
#

oh

#

oki

sweet merlin
#

but if your bot goes offline

#

or logged out

#

that will be reseted

outer violet
#

oh

tiny ibex
#

Eee can someone tell me how to have custom Discord VC party games?

sweet merlin
#

i dont know what u mean, like vc party games with bot?

tiny ibex
#

Check it on google

sweet merlin
#

uh..

tiny ibex
#

Yk it consists of yt together sessions poker night fishington.io and even chess

tiny ibex
#

1 min please

sweet merlin
#

oh u mean the bot will live stream?

tiny ibex
sweet merlin
#

ok

tiny ibex
#

It has pre saved ones but I want to know if custom ones are possible

#

@sweet merlin

#

?

vagrant galleon
#

is there a way to interact with a bot via dms?

#

i send the bot a specific command, and it does stuff in dms rather than a server?

sweet merlin
#

eh

tiny ibex
#

DMchannel

sweet merlin
tiny ibex
vagrant galleon
#

or how would it look?

tiny ibex
#

But I want custom ones

sweet merlin
tiny ibex
#

That's the main question

sweet merlin
vagrant galleon
#

guys pleeeeeeeeeeeeeeeease

manic wing
#

where it sends a dm? whats the aim here

tiny ibex
boreal ravine
#

!d discord.Member.send

unkempt canyonBOT
#

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

Sends a message to the destination with the content given.

The content must be a type that can convert to a string through `str(content)`. If the content is set to `None` (the default), then the `embed` parameter must be provided.

To upload a single file, the `file` parameter should be used with a single [`File`](https://discordpy.readthedocs.io/en/master/api.html#discord.File "discord.File") object. To upload multiple files, the `files` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`File`](https://discordpy.readthedocs.io/en/master/api.html#discord.File "discord.File") objects. **Specifying both parameters will lead to an exception**.

To upload a single embed, the `embed` parameter should be used with a single [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") object. To upload multiple embeds, the `embeds` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") objects. **Specifying both parameters will lead to an exception**.
vagrant galleon
manic wing
vagrant galleon
manic wing
#

you send a command to the bots dm’s…

sweet merlin
#
@bot.event()
async def on_message():
     if 'test' in ctx.content.lower():
          if isinstance(message.channel, discord.channel.DMChannel):
               do something
     else:
          return```
#

i think it should work

vagrant galleon
#

so its an event , not command?

sweet merlin
manic wing
#

commands work in dms…

sweet merlin
manic wing
sweet merlin
manic wing
#

ctx.message.content

little ether
#

to get the content, you'd do ctx.message.content

sweet merlin
manic wing
#

!d discord.channel.DMChannel

unkempt canyonBOT
#

class discord.DMChannel```
Represents a Discord direct message channel.

x == y Checks if two channels are equal.

x != y Checks if two channels are not equal.

hash(x) Returns the channel’s hash.

str(x) Returns a string representation of the channel
vagrant galleon
sweet merlin
#

yeah it work

sweet merlin
#

why u using ctx and message?

slate swan
#

can u post a nitro emoji code for confetti

sweet merlin
#

what is confetti?

#

button?

little ether
slate swan
#

/:confetti:

little ether
#

well i can't help with that

slate swan
little ether
#

i don't have nitro either

slate swan
vagrant galleon
#

how do i authenticate someone to use a command , i want it to be just their command so preferebly by id @slate swan @sweet merlin

sweet merlin
#

u mean getting message id?

vagrant galleon
#

no.. i dont want anyone to use a command for example !test

#

i want just one person based on their id to use this command

#

or ill give them a special role, but preferebly by discord id

sweet merlin
#

oh

#

@commands.is_owner()

#

its for owner of the bot

vagrant galleon
#

but im the owner of the bot

sweet merlin
#

oh

vagrant galleon
#

i want other people to use their own command privately

sweet merlin
#

hmm try using

if ctx.author.id == the id:
  do something
vagrant galleon
#

shi i dont have anyone to test it with

#

could u help me?

sweet merlin
#

sure

trail breach
#

how to pause a channel

#

so that normal role cant send messages

sweet merlin
# trail breach so that normal role cant send messages
permissions = discord.Permissions()
permissions.update(kick_members = False)
await role.edit(reason = None, colour = discord.Colour.blue(), permissions=permissions```

more: https://discordpy.readthedocs.io/en/latest/api.html#permissions
#

i think it should work

sweet merlin
#

change the permission of kick member to false

#

eh

#

wait

trail breach
#

i want a command that closes a channel for other users itks this server also has a similar command

dapper cobalt
#

Update the channel's overwrites and make the guild's default role's send_messages set to False.

#

!d discord.Guild.default_role

unkempt canyonBOT
dapper cobalt
#

!d discord.PermissionOverwrite

unkempt canyonBOT
#

class discord.PermissionOverwrite(**kwargs)```
A type that is used to represent a channel specific permission.

Unlike a regular [`Permissions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions "discord.Permissions"), the default value of a permission is equivalent to `None` and not `False`. Setting a value to `False` is **explicitly** denying that permission, while setting a value to `True` is **explicitly** allowing that permission.

The values supported by this are the same as [`Permissions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions "discord.Permissions") with the added possibility of it being set to `None`.

x == y Checks if two overwrites are equal.

x != y Checks if two overwrites are not equal.

iter(x) Returns an iterator of `(perm, value)` pairs. This allows it to be, for example, constructed as a dict or a list of pairs. Note that aliases are not shown.
dapper cobalt
#

!d discord.TextChannel.edit

unkempt canyonBOT
#

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

Edits the channel.

You must have the [`manage_channels`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_channels "discord.Permissions.manage_channels") permission to use this.

Changed in version 1.3: The `overwrites` keyword-only parameter was added.

Changed in version 1.4: The `type` keyword-only parameter was added.

Changed in version 2.0: Edits are no longer in-place, the newly edited channel is returned instead.
trail breach
#

ok ty

sweet merlin
#

i think it will work

trail breach
sweet merlin
trail breach
#

i just want to restrict ppl with no permissions to be able to type anythin

trail breach
tiny ibex
#

How to check if the user is already in a VC?

hasty loom
little ether
hasty loom
#

ah ok

boreal ravine
hearty karma
#

commands.MemberConverter=None

hasty loom
#

o cool

hearty karma
#

umm

hasty loom
sweet merlin
trail breach
#

discord.guild.has_role('Bot') is this correct

hearty karma
#

what is this place?

little ether
hearty karma
reef shell
#

read the channel topic to know more

hearty karma
#

I know absolutely 0% about coding

reef shell
#

then learn python /coding first

hearty karma
little ether
hearty karma
little ether
#

!resources

unkempt canyonBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

reef shell
hearty karma
#

!resources

unkempt canyonBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

trail breach
hearty karma
#

!commands

reef shell
#

unless you wanna buy some online courses

slate swan
#

hi im new

little ether
slate swan
#

i dont know anything about python or coding

reef shell
unkempt canyonBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

slate swan
#

thanks

trail breach
#

i wanna make a variable of a role

#

how?

slate swan
#

i just want to learn

reef shell
trail breach
#

yes

#

ctx.guild.role,send_messages=False role is the var

#

this was on stack but i dont want default_role

#

so.....

reef shell
trail breach
#

ok

#
@bot.command()
@commands.has_permissions(manage_channels=True)
async def pause_all(ctx):
    role = discord.guild.has_role("new role")
    await ctx.guild.channel.set_permissions(ctx.guild.role,send_messages=False)
    await ctx.channel.send("All channels have been paused pls wait...")```i just wanna puse a channel for the general role but not #everyone
#

@reef shell

reef shell
#

role = discord.utils.get(ctx.guild.roles, name = "general")

trail breach
#

k

reef shell
#

then do whatever you want to do with the role

slate swan
#

Hey, if I want to use Discord Timestamp for userinfo commands to show member.created at and joined_at, how do I convert the times into the ones needed for the timestamp?

trail breach
reef shell
#

Show code

#

And error

trail breach
#
@bot.command()
@commands.has_permissions(manage_channels=True)
async def pause_all(ctx):
    role = discord.utils.get(ctx.guild.roles, name="new role")
    await ctx.guild.channel.set_permissions(ctx.guild.role,send_messages=False)
    await ctx.channel.send("All channels have been paused pls wait...")```
#
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: Forbidden: 403 Forbidden (error code: 50013): Missing Permissions```
reef shell
reef shell
trail breach
#

same error

reef shell
#

also i didn't check correctly before

#

you didn't define the channel var

trail breach
#

do i?

reef shell
#

you need a specific channel to set permissions

trail breach
#

ok so for all do i need guild.channel or guild is enough

reef shell
#

you can get a channel obj. using the same method you used to get a role obj

reef shell
#

then do
channel.set_perm........

trail breach
#

yeah but i dont wanna just pause 1 channel

reef shell
#

then you need to use loop

trail breach
#

i wanna pause the channel where themessage has been sent

reef shell
#

for channel in ctx.guild.text_channels

dusk pumice
#

Umm

reef shell
#

like this

trail breach
#
async def say(ctx,arg):
    await ctx.send(arg)```
dusk pumice
#

can you guys help me with discord.slash

#

or any example codes

reef shell
#

what lib

reef shell
reef shell
#

i asked something else

maiden fable
#

Use ctx.channel.edit and remove the send perms from everyone role

trail breach
trail breach
#

like in this

#

except the default role i want it to be specific to one role

reef shell
#

like i said , you need to use loop for this

maiden fable
#

Yea

trail breach
#

oh

trail breach
reef shell
#

as you got the role obj

#

yea

trail breach
reef shell
#

ok let me spoonfeed you

trail breach
#

no

#
    role = discord.utils.get(ctx.guild.roles, name="new role")
    await ctx.channel.set_permissions(role,send_messages=True)```
#

y wont this work

reef shell
#
for channel in ctx.guild.text_channels:
  channel.set_permission(role, send_messages= False)```
trail breach
#

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: Forbidden: 403 Forbidden (error code: 50013): Missing Permissionsthe error

reef shell
#

your bot is missing perms

#

to set permissions

trail breach
reef shell
#

that's unexpected

#

error in which line

trail breach
#

1 sec

#

i hv done a send message after pausing which is showing error

#

```` await ctx.channel.send("Channel has been unpaused")```

#

however the bot doesnt hv the role

#

also @reef shell if i do for channel is guild.channels: it shows AttributeError: module 'discord.guild' has no attribute 'channels'

maiden fable
#

Guild*

#

discord.guild is a file whereas discord.Guild is a class

trail breach
#

i hv to use Guild?

maiden fable
#

!custom-check

unkempt canyonBOT
#

Custom Command Checks in discord.py

Often you may find the need to use checks that don't exist by default in discord.py. Fortunately, discord.py provides discord.ext.commands.check which allows you to create you own checks like this:

from discord.ext.commands import check, Context

def in_any_channel(*channels):
  async def predicate(ctx: Context):
    return ctx.channel.id in channels
  return check(predicate)

This check is to check whether the invoked command is in a given set of channels. The inner function, named predicate here, is used to perform the actual check on the command, and check logic should go in this function. It must be an async function, and always provides a single commands.Context argument which you can use to create check logic. This check function should return a boolean value indicating whether the check passed (return True) or failed (return False).

The check can now be used like any other commands check as a decorator of a command, such as this:

@bot.command(name="ping")
@in_any_channel(728343273562701984)
async def ping(ctx: Context):
  ...

This would lock the ping command to only be used in the channel 728343273562701984. If this check function fails it will raise a CheckFailure exception, which can be handled in your error handler.

maiden fable
#

@potent jetty ^^^

#

Well u can do for guild then

#

It's just so that u understand how to do so

#

Nope

#

U will have to compare member.guild then

#

Or member.guild == bot.get_guild()

visual island
#

Note: commands.check() wont work, but custom decorator works!

#

sure

maiden fable
#

Mhm

#

But that won't send the message if the guild id is that one

#

Ah

#

Well then remove that return statement

#

And add yr logic instead

hasty iron
#

or you could change == to !=

#

and not remove the return

maiden fable
#

Yea

drifting arrow
#

So

#

still need ideas on what kind of bot to make

boreal ravine
#

hm

stone palm
#
            except discord.MissingPermissions:
                await ctx.send("My role is not high enough to give you roles. Ask a moderator/admin to move my role above your highest role in order for me to give you roles.")
```that would work right
slate swan
#

no ?

spring flax
drifting arrow
#

maybe if I made a game using discord πŸ€”

slate swan
#

hello anyone know why my bot is ofline

sweet merlin
boreal ravine
sweet merlin
#

maybe you put the wrong token? or you didnt run the file?

slate swan
slate swan
sweet merlin
#

can you show me the code?

drifting arrow
boreal ravine
#

whats the error then

sweet merlin
drifting arrow
#

We can only speculate at this point in time. Without the actual code we won't know.

sweet merlin
#

or something

drifting arrow
#

It could be your bot is online you just set it to offline

#

Or your bot is set to the wrong code.

boreal ravine
boreal ravine
slate swan
boreal ravine
drifting arrow
sweet merlin
#

you can

boreal ravine
#

you can?

slate swan
boreal ravine
#

how..?

sweet merlin
slate swan
#

!d discord.Status.offline

unkempt canyonBOT
boreal ravine
boreal ravine
slate swan
#

await bot.change_presence(status=discord.Status.offline)

slate swan
#

Do it

sweet merlin
boreal ravine
#

what the hell

slate swan
#

Probably dnd

#

i got it thank you to all

boreal ravine
slate swan
slate swan
sweet merlin
boreal ravine
#

hm

drifting arrow
#

It would be. but im all outta ideas and I've tried nothing

boreal ravine
#

hm

slate swan
#

Buttons ttt

drifting arrow
#

ttt?

slate swan
#

Buttons fight (like how dank memer's fight works)

drifting arrow
#

what is ttt

oak warren
#

tic tac toe they mean

slate swan
drifting arrow
#

Oh.

oak warren
#

tictac toe is nice but the problem is you need to make sure that only 2 players can use it can they dont use it on each others turn

oak warren
#

that can be one

oak warren
oak warren
drifting arrow
#

Who said you had to strictly use just dpy?

#

dpy is simply the interface.

oak warren
#

hmm right

#

its still confusing

stone palm
#

is discord.Foridden for missing perms

spring flax
oak warren
spring flax
#

no that is you are not allowed to do it
This can be because of missing perms too

oak warren
#

discord.foribidden means discord doesnt allow you to do it

stone palm
#

o

oak warren
#

well no..

stone palm
#

ohh

spring flax
#

yes discord does not let you do it because you are missing perms...

stone palm
#

hmm

oak warren
#

but missing perms is a dpy thing not a discord thing

slate swan
#

Forbidden also gets thrown for missing permissions

spring flax
#

^

oak warren
#

not always

spring flax
#

who said always?

oak warren
#

it happens rarely

spring flax
#

can

slate swan
#

Most of the time when you try to send a message where you're not allowed to, you get Forbidden, so no it happens quite often..

oak warren
#

but its rare

boreal ravine
oak warren
#

^^

slate swan
oak warren
#

and missing perms is because of the decorator @commands.has_permission()

slate swan
#

Not rocket science Β―_(ツ)_/Β―

spring flax
#

or are you guessing

boreal ravine
#

Meaning?

stone palm
#

i c

slate swan
#

MissingPermissions is when the invoker, not the bot doesn't have the permissions to use the command

#

And you need to add a decorator or similar for it to work

oak warren
#

yea that is what i meant

boreal ravine
#

yes

#

thats what we meant

slate swan
#

Forbidden is when the bot can't do something

#

And there's also BotMissingPermissions

sweet merlin
#

guys

#

how do i change the bot "about me"?

oak warren
#

no that is you are not allowed to do it
missingpermission is you dont have the perms to do it

slate swan
sweet merlin
#

like this

fading harness
#

hi

slate swan
#

Bot description

fading harness
#

i want to make slash command in cogs

sweet merlin
#

aight thanks

oak warren
fading harness
#

how do i do

slate swan
#

It's even shown

oak warren
fading harness
slate swan
oak warren
#

you cant make slash commands in dpy

slate swan
#

You need to use a third party library

oak warren
#

yea

fading harness
#

discord-py-slash-command?

sweet merlin
slate swan
#

I'd use discord-py-interactions for slash commands in cogs

fading harness
slate swan
#

Everything's explained there

#

With examples

oak warren
#

yup

stone palm
#

i c

hoary stump
#

πŸ˜„

boreal ravine
# slate swan

By the way it didn't say this before about me's released lol

#

Finally has a use

stone palm
#

await message.add_reaction?

#

is that right

#

!d discord.Message.add_reaction

unkempt canyonBOT
#

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

Add a reaction to the message.

The emoji may be a unicode emoji or a custom guild [`Emoji`](https://discordpy.readthedocs.io/en/master/api.html#discord.Emoji "discord.Emoji").

You must have the [`read_message_history`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.read_message_history "discord.Permissions.read_message_history") permission to use this. If nobody else has reacted to the message using this emoji, the [`add_reactions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.add_reactions "discord.Permissions.add_reactions") permission is required.
stone palm
#

alr nice

#

can i have 2 emojis at once

#

in the same line of code

#

can emoji be a list

slate swan
#

Why would they put it when About Me was not even a thing 🀦

oak warren
#

it was for when you invite the bot

#

before about me's

slate swan
#

Does len(guild.channels) return number of categories + number of channels? Yes right?

#

!d discord.Guild.channels

unkempt canyonBOT
oak warren
#

only channels i guess

slate swan
#

That's weird.. think it's including categories

boreal ravine
#

lol

slate swan
#

As you can see it returns a list of GuildChannel

#

Which includes

  • TextChannel
  • VoiceChannel
  • CategoryChannel
  • StageChannel
#

🀷

#

2 channels 1 text 1 voice

#

Maybe read?

slate swan
#

what?