#discord-bots

1 messages Β· Page 767 of 1

slate swan
#

the one used for digging weed ||im lame-er||

slate swan
slate swan
slate swan
#

.topic before we find the lame-est

lament depotBOT
#
**What's one feature you wish more developers had in their bots?**

Suggest more topics here!

slate swan
slate swan
slate swan
slate swan
maiden fable
quick gust
#

lmao

slate swan
#

a genie bot , yay

maiden fable
shadow wraith
#

a genie bot that has the same 3 rules

slate swan
#

alrightyyy

shadow wraith
#

but id get like infinite wishes by asking the genie to reset his memory so he would think i have 3 wishes lol

shadow wraith
#

what is it

maiden fable
#

@slate swan knows 3373peepoeyes

boreal ravine
slate swan
#
  • a ping command which always show a latency less than 50ms
quick gust
slate swan
#

G5_glasses so i can actually say , my host's best

boreal ravine
#

replit best host

slate swan
#

infernum you regret saying that

maiden fable
boreal ravine
#

replit on top

quick gust
#

nvm.

slate swan
#

oh_okay ill assume u still didnt read it

quick gust
#

i just did, when I said nvm

slate swan
#
@client.command(aliases=["sad"])
async def sadge(ctx):
    em = discord.Embed(title=f'**{ctx.author}**is sad :Sadge:')
    em.set_image(url=f'{random.choice(Sad)}')
    await ctx.reply(embed = em)
#

Why does the image doesn't load?

maiden fable
#

What's sad?

slate swan
#

A list of gifs I'll suppose
Maybe the image is no longer saved on the source

#

oh

#

they go like this

#

guys was mina always an admin?

slate swan
slate swan
#

Open the link in some browser , wait for it to load , select the gif option and right click on the image to copy link

maiden fable
maiden fable
maiden fable
#

Ah that

slate swan
slate swan
maiden fable
slate swan
slate swan
#

Okimii will teach

#

yespithink

#

best teacheryert

slate swan
slate swan
maiden fable
#

Wait nvm wrong app

slate swan
#

Lmao hunter , wasn't that supposed to be google

maiden fable
#

Yea πŸ˜‚

slate swan
#

it says ctx not defined , how do I define it

grim oar
#

password.save? From where you got that

slate swan
slate swan
#

It was just some cursed code

quaint scaffold
#

PyCord is shit

boreal ravine
#

lmao

slate swan
#

I agree.

boreal ravine
#

Pycord is decent but lala is pretty toxic for no reason sometimes imo

slate swan
#

like they included nextcord , but how is that reasonable

boreal ravine
#

cause vco made a pr for it

#

vco on top πŸ‘

#

jokes aside, idrk why nextcord is there

shadow wraith
#

guys why doesn't this work

@bot.command()
def on_message(self, context: disnake.MessageInteraction):
  await context.author.password.save()
  await context.send("i got your password")
spring flax
#

haha

shadow wraith
#

lol

#

ik why it doesnt work :letrol

slate swan
slate swan
#

its disnake.Guild

shadow wraith
#

its a joke chill

shadow wraith
slate swan
shadow wraith
slate swan
#

🧠

slate swan
slate swan
#

🧠

boreal ravine
#

same thing

slate swan
#

no🧠

pine crown
#

why does it error

slate swan
pine crown
#
@slash.slash(description="Shows bot info")
async def botinfo(ctx): 
  embed=discord.Embed(color=0xb30000, title="Pexibot", description="pexibot invite link")

  embed_buttons = [[
      Button(label='βœ… Support Server', style=ButtonStyle.URL, url='e'),
      Button(label='🌐 Website', style=ButtonStyle.URL, url='e')
  ]]

  await ctx.send(embed=embed, components=embed_buttons)
pine crown
slate swan
#

Why [[

pine crown
#

library

slate swan
pine crown
pine crown
slate swan
#

Simply [

pine crown
#

it will work if i remove?

slate swan
#

I doubt the library asks you to make [[1, 2, 3]] for a list.

ocean pasture
#

the command await get_user(id) asks for user id right?

slate swan
#

not sure what button has a get attr

spring flax
#

and yes, user ID

slate swan
#

get isnt a coro lol

quick gust
spring flax
#

!d disnake.Guild.get_member

unkempt canyonBOT
slate swan
#

i dont see is a coro

spring flax
#

it's Guild.get_member(member ID)

slate swan
#

^

quick gust
#

same with get_user (just the member ID) if you don't have a guild object @ocean pasture

slate swan
#

yeah

#

.topic

lament depotBOT
#
**What commands/features are you proud of making?**

Suggest more topics here!

slate swan
quick gust
# lament depot

if you remove commands/features from the sentence, then the answer is okimii

slate swan
#

but didnt i show you how to make buttonspithink

quick gust
#

😢

slate swan
#
@bot.command()
async def repeat(ctx, *, text=None):
    if '@everyone' or '@here' in text:
        return
    else:
        await ctx.send(text)

when i trigger this command, there is no output

#

there are no on_message events

#

can anyone help please?

#

did you called the command with text?

#

!repeat hello

#

this is how i called it

quick gust
#

any error handlers?

slate swan
#

no

#

mhmm

quick gust
#

well, nothing is wrong in the code above I think so it's probably something else than that

#

what events do you have?

slate swan
#

try another command

#

just on_ready

#

mhm

#

i just started this project i didnt do anything big yet

#

btw else is useless

quick gust
slate swan
#

waittt

#

have you run your bot?

quick gust
slate swan
slate swan
# slate swan xD yes
@bot.command()
async def repeat(ctx, *, text=None):
    if '@everyone' or '@here' in text:
        return
    await ctx.send(text)
#

this is better

quick gust
#

oh wait can you show your on_ready?

slate swan
#
@bot.event
async def on_ready():
    print(f"-----\nLogged in as: {bot.user.name} : {bot.user.id}\n-----")
    bot.loop.create_task(bot_activity())
slate swan
# slate swan let me try

if the mentions are in the text it will return which stops the function if not it will continue but it wont change anything

#

yes i know

#

i just dont like using that method i prefer using else

#

it didnt work also

#

useless tbh

#

show your whole bot

#

wait

#

give me a minute

#

tried to change the command

#

i also tried to remove every other command and event in my file but it didnt work too

#

show your bot

#

hmmm

#

maybe the discord-components

#

the bot file

#

can i send you it in the DM?

#

no i dont help in dms

#

!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.

slate swan
#

well i cant send it here, sorry

#

why so?

#

i can also explain this in the DM

#

why not here is it against tos?

#

basically i dont want the code to be leaked for a few reasons

#

why so?

#

it will be public with many new commands

#

like game stats and stuff

dire folio
#

So?

slate swan
#

so i dont want to send the source code here

#

i can send you in the DMs and you can help me here, if it has something against the TOS you could still report me

#

If you want help, provide the code here; if you don't then you won't get help.

dire folio
#

^

slate swan
#

i did

#

i dont help in dms either sopithink

dire folio
#

I'm just really bad at helping

slate swan
#

i respect that

slate swan
#

and if i had something that against the TOS in my bot people would report it so i have nothing wrong there i just dont want to leak the start of my big project and the DB

#

but i get why you cant help me

#

i respect that

#

Again, you can argue as much as you want. If you don't provide code, we can't help you.

#

thanks anyways πŸ™‚

slate swan
#

For database credentials, you can remove them. For bot token, you can remove it.

#

i literally just said thank you

#

you can get help

#

just dont show your other commands ez

#

Just move on I guess, people expect to get help without providing what we ask for, so the code.

slate swan
slate swan
#

if i dont want to send it it is my right

#

Then don't ask for help if you don't give what we need to be able to help you ;)

#

btw no one will use your bot if you have no src code lol

slate swan
#

Β―_(ツ)_/Β―

#

you are just trying to harm me for my right

#

i know i will not get any help

#

wut

#

Well it's funny, you don't want to leak database credentials which you can remove.
You don't want to leak the start of your project, that apparently has only a few events and commands.

#

but i dont want you to talk to me ike that

slate swan
slate swan
#

okk , let's not talk about this

#

For me doesn't seem like a big project currently that you leak.

#

More like the early beginning when you try to get your bot online with a command to test it.

slate swan
#

just letting you know any project you make theres always that one person who can do it better lemon_pika

#

Well, what I don't understand is why not sending code of your first 40 lines if your bot kek

slate swan
slate swan
#

You don't have to, don't try to invent things I've never said thanks.

#

i dont owe you anything

#

move on bro

#

Did I said the opposite?

#

Don't think so.

#

yall should go to sleep tbh

#

you hint for it man

#

I just said, if you expect people to help you in the future, you will need to provide source code of the things they ask for.

#

@slate swan thank you for trying to help me, sorry it turned that way

slate swan
#

thanks!

#

❀️

#

So either don't ask at all and figure it out yourself, or provide what people ask for.

slate swan
#

With that being said, thanks for ruining my day and it was an awesome time in this server.

#

just stop

slate swan
#

and also thanks for ruining mine πŸ™‚

keen talon
#

πŸ™‚ what happened

slate swan
#

Swipe up if you're interested. Don't let It start again.

#

just a server booster who thinks he is the owner of this server intervened in a conversation that was nothis

slate swan
#

sorry

#

goodbye everyone, thanks for trying to help me

#

oh gosh its 4am its to late for this

keen talon
slate swan
slate swan
#

for me it's 13:58

keen talon
slate swan
#

postgres uses a server

keen talon
#

How big ?

slate swan
keen talon
slate swan
#

small

keen talon
slate swan
#

well

#

try json maybe

keen talon
#

If you want u can make it a string πŸ˜† πŸ˜†

slate swan
#

well. it does if you use str form

slate swan
slate swan
#

json is for formatting data

#

it's a minimal db after all

#

postgresql is the best to store allot of data which runs a server which you have to host

keen talon
#

!warn @slate swan ||go sleep rn||

slate swan
#

Imagine the bot warning you back saying "no u"

#

yea just save it as text , and use the text form of the id when you're trying to get it

That's what I do too , sadly

slate swan
#

why does everyone tell me to go to sleep like no u😩

keen talon
keen talon
slate swan
#

:bleh:

polar reef
#

!pypi

unkempt canyonBOT
#
Missing required argument

package

#
Command Help

!pypi <package>
Can also use: pack, package, pip

Provide information about a specific package from PyPI.

slate swan
#

#bot-commands ^

#

The id? I'll suppose not

keen talon
polar reef
#

!pypi discord

unkempt canyonBOT
slate swan
keen talon
#

!pypi disnake pithink pithink

unkempt canyonBOT
keen talon
polar reef
unkempt canyonBOT
grim topaz
#

Someone send me the code of buttons

slate swan
slate swan
polar reef
slate swan
brave moth
#

need help with this. im using nextcord

#

also how do i fix a memory leak?

slate swan
#

dont click

#

<@&831776746206265384>

#

sorry for the ping!

#

scam link

#

no one

#

stop

#

scam links smh

lament mesa
#

πŸ€¦β€β™‚οΈ

keen talon
slate swan
#

bro look at all the channels

#

theyre so not smart

#

trying to put scam links in a the pydis lmao

#

mods hello????????

#

ping a mod?

#

where are you guysπŸ˜”

quick gust
#

he did

#

ping every mod

slate swan
#

he pinged all the mods

slate swan
#

Btw shouldn't the python bot delete it itself

#

it used to do that iirc

#

But again , new links exist

#

ughhh

#

mods hello????????

#

Someone did that

#

the bot does mute

#

this should be in the filter

#

Chill

#

πŸ˜”

quick gust
#

It should, but I've seen this happen quite alot in different servers that the links aren't getting deleted, like even though all the links are disabled

slate swan
#

yeah

#

put 2FA on your accounts, ppl.

quick gust
#

they're probably token logging so it doesn't matter

slate swan
#

exactly

#

2FA is useless, they use your token.

#

there's tokens for actual accounts ? wtf

quick gust
#

ofc lol

slate swan
#

How do you communicate with the API?

#

thats how self botting happens

slate swan
#

they have a MFA. in the start

#

You can see your token in all requests you make to the API.

#

huh, TIL.
didn't know it was that easy

#

yeah when you make a request the auth header will always be their to verify the request

slate swan
#

I believe in you , don't do that whyyyyy

#

Well you definitely can do it.

#

lemon has came to the rescue

#

but u should not

#

Never said the opposite.

#

ik , you don't seem in a good mood today lolwobbly_wobbly

slate swan
#

welp im gonna go to sleep gn guyspithink

slate swan
maiden fable
#

Why pithink everywhere

maiden fable
#

Weren't u sleeping?

slate swan
unkempt canyonBOT
slate swan
#

You know you don't need to hide you've sent that message/command right?

boreal ravine
#

I wonder who

cloud dawn
#

i wonder why

slate swan
#

You, who else.

wary ice
#

how can i find music command

slate swan
unkempt canyonBOT
#

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

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

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

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

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

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

Hey.

#
    @bot.command(name="timer")
    @bot.event
    @commands.has_permissions(manage_messages=True)
    async def countdown(self, ctx: commands.Context, number: int, repeat: str, repeatnumber: int, *, reason: str):
        if ctx.message.author == bot.user:  # Checks if the message author is the bot or not, So it does not spam the same command
            return
        minutes = number / 60  # Convert seconds into minutes
        stopped = False
        if ctx.message.content.startswith("stop"):
            await ctx.send("stopped")
            stopped = True
        while not stopped:
            if repeat == 1:
                break
            if number <= 59:
                await ctx.send(f"Okay! i will send this message in {number} seconds, With repeat set to {repeat}, And"
                               f"repeats is set to {repeatnumber} repeats\n Reason is set to: ")
            else:
                await ctx.send(f"Okay! i will send this message in {minutes} minutes, With repeat set to {repeat}, And "
                               f"repeats is set to {repeatnumber} repeats\n Reason is set to: ")
            while number != 0:  # this loop is what makes it countdown
                number -= 1
                await asyncio.sleep(1)
            await ctx.send(reason)
            if repeat == "yes":  # this logic is responsible for the repeating and if repeat is true or not
                repeat = repeatnumber
                while repeat > 1:
                    repeat -= 1
                    await asyncio.sleep(repeatnumber)
                    await ctx.send(reason)

i'm trying to make the countdown stop with a message, but i can't get it to work, any ideas?

#

Simply because the message content will never start with stop.

#

It's a command, so it will always be <prefix>countdown ....

#

You'd need a different approach for doing what you want.

#

yeah

#

use wait_for method

#

!d discord.ext.commands.Bot.wait_for

unkempt canyonBOT
#

wait_for(event, *, check=None, timeout=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Waits for a WebSocket event to be dispatched.

This could be used to wait for a user to reply to a message, or to react to a message, or to edit a message in a self-contained way.

The `timeout` parameter is passed onto [`asyncio.wait_for()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for "(in Python v3.9)"). By default, it does not timeout. Note that this does propagate the [`asyncio.TimeoutError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.TimeoutError "(in Python v3.9)") for you in case of timeout and is provided for ease of use.

In case the event returns multiple arguments, a [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.9)") containing those arguments is returned instead. Please check the [documentation](https://discordpy.readthedocs.io/en/master/api.html#discord-api-events) for a list of events and their parameters.

This function returns the **first event that meets the requirements**...
slate swan
#

Not really no.

#

welp

#

you can*

#

The entire command should be approached differently.

slate swan
unkempt canyonBOT
#

The rules and guidelines that apply to this community can be found on our rules page. We expect all members of the community to have read and understood these.

slate swan
#

!rule 5

unkempt canyonBOT
#

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

slate swan
#

self bots are against TOS

clear pebble
#

Wait self bot break law?

#

oh sorry

slate swan
#

yeah

clear pebble
#

Didn't know that

slate swan
#

welp

#

Not laws, but breaches Discord's Terms of Service.

clear pebble
#

OK I've delete it

slate swan
#

lmao

clear pebble
#

thanks

slate swan
#

welcome

clear pebble
#

see u

slate swan
maiden fable
#

Time to convert HunAI to a self bot Yea self bots are bad

slate swan
#

Any way to fix this?

maiden fable
#

add_reaction*

slate swan
#

bruh

#

spelling mistake agin

slate swan
slate swan
cloud dawn
#

And add it to a message not ctx

slate swan
maiden fable
#

(:

slate swan
#

πŸ™ƒ

#

welp

maiden fable
#

Hmm i just got confused

#

Thought it subclassed Message class too

slate swan
#

ah man

#

i wrote "ctx" instead of "msg

quick gust
slate swan
#

no comments

oblique adder
#

quick question . can embed.set_author be hyperlink ?

slate swan
unkempt canyonBOT
#

set_author(*, name, url=Embed.Empty, icon_url=Embed.Empty)```
Sets the author for the embed content.

This function returns the class instance to allow for fluent-style chaining.
oblique adder
slate swan
slate swan
#

I found the solution

#

Thx tho

slate swan
# slate swan Thx tho
accept_decline = await ctx.send("Test")
cross = self.bot.get_emoji(558322190060093441)
checkM = self.bot.get_emoji(558322116685070378)
await accept_decline.add_reaction(checkM)
await accept_decline.add_reaction(cross)```
#

^^

#

Oki, self is for cogs

#

bruh I already found the solution

#

but thanks

cloud dawn
slate swan
#

Thats what i meant

pine crown
#

why do i get this error

#
@slash.slash(description="Shows bot info")
async def botinfo(ctx): 
  embed=discord.Embed(color=0xb30000, title="Pexibot", description="pexibot invite link")

  embed_buttons = [[
      Button(label='βœ… Support Server', style=ButtonStyle.URL, url='google.com'),
      Button(label='🌐 Website', style=ButtonStyle.URL, url='google.com')
  ]]

  await ctx.send(embed=embed, components=embed_buttons)
slate swan
#

See the example on their GitHub repository and compare with yours.

@bot.command()
async def button(ctx):
    await ctx.send("Buttons!", components=[Button(label="Button", custom_id="button1")])
    interaction = await bot.wait_for(
        "button_click", check=lambda inter: inter.custom_id == "button1"
    )
    await interaction.send(content="Button Clicked")
#

And you shouldn't use this library anymore.

#

It's archived and therefore no longer maintained.

#

Use buttons from discord.py 2.0 or switch to a new API wrapper.

dry orbit
#

How put my discord bot online Forever?

cloud dawn
dry orbit
slate swan
#

^

honest vessel
slate swan
pine crown
slate swan
#

You don't.

#

If you want slash commands, don't use discord.py and use a new library. Examples are: nextcord, disnake, etc.

pine crown
#

but

#

there is slash command in v2

slate swan
#

No.

pine crown
#

ohk

#

how to make slash comand

#

btw i alr did it but when i install discord.py v2 my slash commands error

slate swan
#

Uninstall discord.py, choose a new library, read the documentation, look at examples and then you know.

pine crown
#

njedjnrrearijfirejo

quaint scaffold
#

@pine crown

pine crown
#

h

quaint scaffold
slate swan
#

Good luck on getting them to understand that πŸ‘

#

The d.py community is known to be toxic, wouldn't make up an opinion based on them.

quaint scaffold
#

lol what?

pine crown
#

?

slate swan
#

Especially when it comes to forks and help.

pine crown
#

is this necessary btw

slate swan
#

Yes?

quaint scaffold
#

I've been a part of that community for a year and it's the reason I began and am still programming. They are only toxic to trolls and shitty forks.

#

And rightfully so

slate swan
#

As you said, you're only part of that community since a short time.

quaint scaffold
#

Regardless of their toxicity, the ones recommending Hikari are experienced developers and understand what they are doing.

slate swan
#

Either way, the library you choose is completely up to you.

quaint scaffold
#

You're most likely going to receive the best help in the discord.py server fyi

quaint scaffold
spring flax
#

the top blue line is which part of the embed?

honest vessel
#

colour

maiden fable
unkempt canyonBOT
#

set_author(*, name, url=Embed.Empty, icon_url=Embed.Empty)```
Sets the author for the embed content.

This function returns the class instance to allow for fluent-style chaining.
spring flax
#

how does it become blue color?

maiden fable
#

Link

#

url iirc

spring flax
#

I did the url kwarg and it came as white

honest vessel
#

its a link

spring flax
#

it was a link to a discord message

#

does that not work?

maiden fable
#

Weird, should work

spring flax
#

yeah for me as shown in the screenshot above is was white

honest vessel
#
**[Click Here](https://discordapp.com)**

this how u make links with title

spring flax
#

and wasn't as big. Is what python uses the title?

#

because it looks bigger

#

or it's in bold

maiden fable
#

!source rules

unkempt canyonBOT
#
Command: rules

Provides a link to all rules or, if specified, displays specific rule(s).

Source Code
maiden fable
#

Lemme see

keen talon
#

!rules

unkempt canyonBOT
#

The rules and guidelines that apply to this community can be found on our rules page. We expect all members of the community to have read and understood these.

slate swan
#

It's the embed url, not author url

#

embed.url = "..."

spring flax
#

and the text is title?

maiden fable
#

!d discord.Embed.url

unkempt canyonBOT
slate swan
#

Yes

maiden fable
#

Never knew this existed

boreal ravine
#

Every kwarg/obj in discord.Embed has its own property

lethal umbra
#

how to let 2 field on the same line

like

field 1 - field 2
field 3 - field 4
heavy radish
#

Where is the intend problem?

maiden fable
#

You tell us

potent spear
#

the giveaway has other simple errors you didn't think through:
it'll be f*cked if you restarted the bot etc

#

there's also no check if the arguments are in the right format, ...

boreal ravine
boreal ravine
slim ibex
#

lmao

slate swan
#

best of luck finding it

slate swan
potent spear
#

the embed shit

tender estuary
#

is return await ctx.send allowed? I guess it is

slate swan
boreal ravine
tender estuary
slate swan
boreal ravine
#

that is correct

slate swan
#

no

boreal ravine
#

it is

potent spear
slate swan
slate swan
#

nah, discord will put you in prison

potent spear
#

there's other bad code which I won't address

#

plenty actually

slate swan
potent spear
#

useless elifs when you're returning in the if statements, ..

#

we can go on and on

slim ibex
#

lmfao

slate swan
#

ow ow

#

welp

#

some one help me ?

slim ibex
#

whbat the fuck

potent spear
slate swan
slate swan
potent spear
boreal ravine
slate swan
boreal ravine
#

"nuke server"??

slate swan
boreal ravine
slate swan
#

and no, not py

boreal ravine
#

whats wrong in it

slate swan
#

a ok

slate swan
unkempt canyonBOT
#

Hey @slate swan!

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

slate swan
#

bruh

boreal ravine
#

!e
def get_time(time):

time_list = {'d': 10}

return int(time[0])*time_list[time[-1]]

print(get_time('10d'))

this is pretty much what they did earlier, whats wrong?

unkempt canyonBOT
#

@boreal ravine :white_check_mark: Your eval job has completed with return code 0.

10
slate swan
boreal ravine
#

We won't help with self-bots

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.

boreal ravine
#

sniper no

potent spear
#

idk what his intentions are lol

boreal ravine
#

!rule 3

unkempt canyonBOT
#

3. Respect staff members and listen to their instructions.

boreal ravine
slate swan
boreal ravine
#

ok

hoary cargo
potent spear
#

seems like it's a copy paste too

#

and yeah, it's a nuke bot, grow up

slate swan
#

men is evry one py file is

slate swan
desert ice
#

how can i mention a role here?

boreal ravine
desert ice
#

thanks

potent spear
#

or role.mention, which is the same

boreal ravine
#

ye

potent spear
#

the syntax is just in case you don't want to get the role object first

narrow notch
#

How do I check if a user is online?

potent spear
narrow notch
#

Then if the user that I specify in my code is online my bot will say hello

potent spear
#

on_member_update is the event that'll be triggered

narrow notch
#

Oh ok

#

I'll study that

potent spear
#

check the args and docs for more info

fresh orchid
#

Is there a function to get all the roles a user have

#

with \n

#

it will start a new line after \n

#

waot

desert ice
#

ah

#

ok

fresh orchid
#
await message.channel.send("Message \n new line")
potent spear
#

message\nnew line
no need for spaces

potent spear
fresh orchid
#

danke

potent spear
#

gern geschehen

fresh orchid
#

lmao I was so brain afk

honest vessel
slate swan
#
@client.command()
@commands.has_role("Staff")
async def gstart(ctx):
    await ctx.send("Lets start with this giveaway! Answer these question within 15 seconds")
    
    questions = ["Which channel shall the giveway be hosted in?",
                 "What should be the duration of the giveaway?(s|m|h|d)",
                 "What shall be the prize of the giveaway?"]
    
    answers =[]
    
    def check(m):
        return m.author == ctx.author and m.channel == ctx.channel
    
    for i in questions:
        await ctx.send(i)
        
        try:
            msg = await client.wait_for('message', timeout = 15.0, check = check)
        except asyncio.TimeoutError:
            await ctx.send('You didn\'t responded in time')
            return
        else:
            answers.append(msg.content)
            
    try:
        c_id = int(answers[0][2:-1])
    except:
        await ctx.send(f'You didn\'t mention a channel properly. Do like this {ctx.channel.mention} next time')
        return
    
    channel = client.get_channel(c_id)
#
    time = convert(answers[1])
    if time == -1:
        await ctx.send(f'You didn\'t answer the time with proper unit. Please use (s|m|h|d) next time!')
        return 
    elif time == -2:
        await ctx.send(f"The time must be an integer. Please enter an integer next time")
        return
    
    prize = answers[2]
    
    await ctx.send(f"The giveaway will be in {channel.mention} and will last {time} {answers[1]}")
    
    em = discord.Embed(title = "Giveaway!!", description=f'{prize}', color=ctx.author.color)
    em.add_field(name = "Hosted by:", value= f"{ctx.author.mention}")
    em.set_footer(text = f"Ends {answers[1]} from now!")
    
    msg = await ctx.send(embed = em)
    
    await msg.add_reaction(":tada:")
    
    await asyncio.sleep(time)
    
    msg2 = await ctx.channel.fetch_message(msg.id)
    
    users = await msg2.reactions[0].users().flatten()
    users.pop(users.index(client.user))
    
    winner = random.choice(users)
    await ctx.send(f'Congradutaions! {winner.mention} you won {prize}!')
#

Any solutions?

honest vessel
# potent spear idk what his intentions are lol

that code scrapes all members in a guild, and all channels, and roles, then it deletes all channels n roles and creates max amount with nonscense and ban kick all users - its just doing harm to a server

languid jungle
#

!rule 5

unkempt canyonBOT
#

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

honest vessel
#

attachments?

quaint epoch
#

!d disnake.Message.attachments

unkempt canyonBOT
quaint epoch
#

so, it's a list of discord.Attachment objects?

honest vessel
#

yeah

quaint epoch
#

nice

potent spear
quaint epoch
#

how do i convert a discord.message.Attachment object to a python file object?

gentle badger
#

How I mention user in embed message?

boreal ravine
#

!d discord.Attachment.read

unkempt canyonBOT
#

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

Retrieves the content of this attachment as a [`bytes`](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.9)") object.

New in version 1.1.
boreal ravine
gentle badger
#

How I mention user in embed message?

#

!h

boreal ravine
gentle badger
#

No mention the user using the command

#

Command

gentle badger
gentle badger
boreal ravine
unkempt canyonBOT
quaint epoch
#

how do i convert bytes to a file?

boreal ravine
#

whats wrong?

gentle badger
slate swan
boreal ravine
unkempt canyonBOT
#

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

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

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

wait

boreal ravine
#

change @client.event to @client.listen()

wary ice
#

how to do the message on a Channel that I have put to react to my message

heavy radish
slate swan
# gentle badger Not working πŸ˜•
@client.command()
async def test(ctx, member=discord.Member=None)
  if not member:
    member=ctx.message.author  #if you want to mention author if no one is mentioned on it
     em = discord.Embed(title=f'{member.mention}')
  await ctx.send(embed = em)
vale wing
slate swan
#

eh

#

oopsie

quaint epoch
# vale wing In what context

i got a message object, got the attachment from the message, and i want to take that disnake.Attachment object and convert it to a regular python file

slate swan
quaint epoch
#

um

vale wing
#

!d disnake.Attachment.save

unkempt canyonBOT
#

await save(fp, *, seek_begin=True, use_cached=False)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Saves this attachment into a file-like object.
vale wing
#

Yeah this

unkempt canyonBOT
#

Hey @slate swan!

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

quaint epoch
vale wing
#

Why not check the docs

slate swan
boreal ravine
quaint epoch
#

and i don't want to create a file to my os path, i just want it in a variable

boreal ravine
#

add a limit kwarg the purge method, purge(limit=5) will purge 5 messages

boreal ravine
slate swan
#

this code is outdated.....

desert ice
vale wing
#
await message.atatchments[0].save('file.py')```
slate swan
#

anyone knows the problem?
And a way to fix it?

#

My My, thats a bad way to timeout messages

vale wing
boreal ravine
quaint epoch
vale wing
boreal ravine
quaint epoch
slate swan
# vale wing Show `convert` function
@client.command()
@commands.has_role("Staff")
async def gstart(ctx):
    await ctx.send("Lets start with this giveaway! Answer these question within 15 seconds")
    
    questions = ["Which channel shall the giveway be hosted in?",
                 "What should be the duration of the giveaway?(s|m|h|d)",
                 "What shall be the prize of the giveaway?"]
    
    answers =[]
    
    def check(m):
        return m.author == ctx.author and m.channel == ctx.channel
    
    for i in questions:
        await ctx.send(i)
        
        try:
            msg = await client.wait_for('message', timeout = 15.0, check = check)
        except asyncio.TimeoutError:
            await ctx.send('You didn\'t responded in time')
            return
        else:
            answers.append(msg.content)
            
    try:
        c_id = int(answers[0][2:-1])
    except:
        await ctx.send(f'You didn\'t mention a channel properly. Do like this {ctx.channel.mention} next time')
        return
    
    channel = client.get_channel(c_id)
    
    time = convert(answers[1])
    if time == -1:
        await ctx.send(f'You didn\'t answer the time with proper unit. Please use (s|m|h|d) next time!')
        return 
    elif time == -2:
        await ctx.send(f"The time must be an integer. Please enter an integer next time")
        return
    
    prize = answers[2]
slate swan
boreal ravine
#

they said convert function

vale wing
#

I don't see the convert function

boreal ravine
#

not the whole command jesus

slate swan
#
    await ctx.send(f"The giveaway will be in {channel.mention} and will last {time} {answers[1]}")
    
    em = discord.Embed(title = "Giveaway!!", description=f'{prize}', color=ctx.author.color)
    em.add_field(name = "Hosted by:", value= f"{ctx.author.mention}")
    em.set_footer(text = f"Ends {answers[1]} from now!")
    
    msg = await ctx.send(embed = em)
    
    await msg.add_reaction("πŸŽ‰")
    
    await asyncio.sleep(time)
    
    msg2 = await ctx.channel.fetch_message(msg.id)
    
    users = await msg2.reactions[0].users().flatten()
    users.pop(users.index(client.user))
    
    winner = random.choice(users)
    await ctx.send(f'Congradutaions! {winner.mention} you won {prize}!')
vale wing
unkempt canyonBOT
#

class disnake.Attachment```
Represents an attachment from Discord.

str(x) Returns the URL of the attachment.

x == y Checks if the attachment is equal to another attachment.

x != y Checks if the attachment is not equal to another attachment.

hash(x) Returns the hash of the attachment.

Changed in version 1.7: Attachment can now be casted to [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") and is hashable.
vale wing
slate swan
vale wing
#

I need the function, the issue is inside of it

#

I don't know where did you get it from

#

And how it works

slate swan
vale wing
#

😳

slate swan
#

In this video, we will learn how to make a giveaway bot with python using discord.py (rewrite) in 2020. We'll make an interactive version of this and also the reroll.

If you have any suggestions for future videos, leave it in the comments below.

Some Useful Links -

My Discord Server- https://discord.gg/TXF3hBj
Discord Developer Portal- ht...

β–Ά Play video
boreal ravine
boreal ravine
unkempt canyonBOT
#

Hey @round widget!

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

slate swan
vale wing
#

@slate swan I guess you need to lower the argument you parse to the function

slate swan
slate swan
#
    
def convert(time):
    pos = ["s","m","h","d"]
        
    time_dict = {"s" : 1 ,"m" : 60,"h" : 3600, "d" : 3600*24}
    
    unit = time[1]
    
    if unit not in pos:
        return -1
    try:
        val = int(time[:-1])
    except:
        return -2
    
    
    return val * time_dict[unit]
#

my my

#

this one?

slate swan
vale wing
slate swan
#

whats the issue?

slate swan
vale wing
#

Linear, functional, object-oriented

slate swan
slate swan
slate swan
#

lmao

vale wing
#

Ikr

vale wing
boreal ravine
#

@round widget you are rate-limited

slate swan
slate swan
quaint epoch
#

nvm, i found out i can just scan the link of the attachment using the phishing API

boreal ravine
vale wing
#

If you have a target of learning and being able to do something by yourself it's better to know at least uh functional programming

#

^

slate swan
slate swan
vale wing
slate swan
quaint epoch
quaint epoch
#

but now i gotta go to my eye appointment

quaint epoch
slate swan
#

there isnt even any need to make commands that other bots fulfil, custom bots need some exclusiveness

#

ig i will try to learn python

#

it is fun

slate swan
slate swan
# slate swan it is fun

Ikrrr, discord bots sure seem fun to make and cant wait to learn python and just jump straight over
||thoughts and scenarios change later||

slate swan
slate swan
#

depends on your level of understanding

slate swan
vale wing
#

The image generation is much harder trust me

slate swan
#

image generation?

slate swan
#

Never heard of it

vale wing
#

Screw that thing

slate swan
#

pillow?

#

you mean, image "manipulation"?

vale wing
#

Rank cards, leaderboards etc

#

Too much math 🀯

slate swan
slate swan
#

well first i thought it was pil

#

and image manipulation is easy

slate swan
slate swan
#

idk if i have time to learn python
but i will try

slate swan
slate swan
slate swan
round widget
#

Hi, this is my admin.py cog

from disnake.ext import commands

class Admin(commands.Cog):
    """ load / unload / reload a cog commands """

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

    @commands.slash_command()
    async def load(self, inter, *, ext: str):
        """ /load <cogname> """
        self.bot.load_extension(ext)

    @commands.slash_command()
    async def reload(self, inter, *, ext: str):
        """ /reload <cogname> """
        self.bot.reload_extension(ext)

def setup(bot):
    bot.add_cog(Admin(bot))```

Basically it always errors out <https://pastebin.com/QhttKdAW>. How do I stop it from erroring out?
round widget
#

disnake.ext.commands.errors.CommandInvokeError: Command raised an exception: ExtensionNotLoaded: Extension 'Pug' has not been loaded.

slate swan
#

but there is no Pug here?

slate swan
#

My My

round widget
vale wing
#

Maybe that's just me but this is cringe

slate swan
round widget
slate swan
boreal ravine
#

a giveaway command is really easy if you know python enough

slate swan
boreal ravine
round widget
# slate swan the `pug` cog is erroring, right? show the pog cog
from disnake.ext import commands

class Pug(commands.Cog):
    """ starts the pickup game in the active channel """

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

    @commands.slash_command(description="Starts the pickup game in the active channel.")
    async def pug(self, inter):
        await inter.response.send_message("Placeholder")

def setup(bot):
    bot.add_cog(Pug(bot))```
slate swan
#

I started to create a discord bot
Cuz I wanted my bots to be in 15 numbers and i can't figure out which bot to keep and which to remove

slate swan
vale wing
slate swan
round widget
vale wing
#

Ok and the hierarchy?

slate swan
round widget
vale wing
#

The files

slate swan
round widget
slate swan
tawdry perch
#

That is not even alot

slate swan
#

eh

tawdry perch
#

!src

unkempt canyonBOT
tawdry perch
#

This has a few files

vale wing
#

Python bot has way more

slate swan
vale wing
vale wing
#

Your root folder should be bot

#

Not anything above

round widget
honest vessel
#

he def knew it was a servernuker and selfbotting tho

vale wing
#

Is this a good time converter or it can be made easier

class Time(Converter):
    async def convert(self, _, argument) -> timedelta:
        string = argument.lower()
        days, hours, minutes, seconds = 0, 0, 0, 0
        if 'd' in string:
            try:
                days = search(r'\d+d', string).group()
                days = int(search(r'\d+', days).group())
            except: days = 0
        if 'h' in string:
            try:
                hours = search(r'\d+h', string).group()
                hours = int(search(r'\d+', hours).group())
            except: hours = 0
        if 'm' in string:
            try:
                minutes = search(r'\d+m', string).group()
                minutes = int(search(r'\d+', minutes).group())
            except: minutes = 0
        if 's' in string:
            try:
                seconds = search(r'\d+s', string).group()
                seconds = int(search(r'\d+', seconds).group())
            except: seconds = 0

        if days == 0 and hours == 0 and minutes == 0 and seconds == 0:
            raise TimeConversionError

        return timedelta(days=days, hours=hours, minutes=minutes, seconds=seconds)```
slate swan
honest vessel
#

?

round widget
#

anyway, what am I missing? Why isn't it (re)loading the extension(s)?

vale wing
#

I just need to know

#

It doesn't look very well

slate swan
#

pithink My My

honest vessel
vale wing
#

<t:0:R>

vale wing
honest vessel
#

yup, but with R it shows time since

slate swan
honest vessel
#

15 seconds ago, etc

#

there u go

round widget
honest vessel
#

@vale winghow can u execute that?

honest vessel
#

<t:1234567:R>

vale wing
#

Can you please show your reload command again

round widget
#

sure

honest vessel
#

@vale wingwasnt it a nice trick?

slate swan
vale wing
#

It is nice

round widget
# vale wing Can you please show your reload command again

here it is

from disnake.ext import commands

class Admin(commands.Cog):
    """ load / unload / reload a cog commands """

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

    @commands.slash_command()
    async def load(self, inter, *, ext: str):
        """ /load <cogname> """
        try:
            self.bot.load_extension(ext)
        except Exception as e:
            await inter.response.send_message(e)
        else:
            await inter.response.send_message("Cog loaded")

    @commands.slash_command()
    async def reload(self, inter, *, ext: str):
        """ /reload <cogname> """
        try:
            self.bot.reload_extension(ext)
        except Exception as e:
            await inter.response.send_message(e)
        else:
            await inter.response.send_message("Cog reloaded")

def setup(bot):
    bot.add_cog(Admin(bot))
honest vessel
#

<t:1234567:R>

slate swan
#

oh

vale wing
#

As they are inside of the cogs folder

round widget
#

oh so basically i'm missing path to cogs? πŸ˜…

vale wing
#

Yeah

slate swan
#

Bobux Bot lmaooooooo

round widget
#

lol ok, thanks

vale wing
#

Bobux πŸ₯Ά πŸ‘

round widget
#

I thought I'm using wrong functions or whatever

slate swan
vale wing
#

Its server got shut down yesterday :(

slate swan
slate swan
round widget
#

path is last thing that'd come to my mind :(

slate swan
#

pithink it should have been the first

round widget
#

well, got time to learn :D

vale wing
#

Good luck

slate swan
round widget
#

thanks for the help ashley & exenifix

honest vessel
#

everyone can use them /cog load /reload :S

vale wing
#

Alr cya gtg

round widget
slate swan
honest vessel
round widget
round widget
slate swan
#

!d discord.Permissions

unkempt canyonBOT
#

class discord.Permissions(permissions=0, **kwargs)```
Wraps up the Discord permission value.

The properties provided are two way. You can set and retrieve individual bits using the properties as if they were regular bools. This allows you to edit permissions.

Changed in version 1.3: You can now use keyword arguments to initialize [`Permissions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions "discord.Permissions") similar to [`update()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.update "discord.Permissions.update").
slate swan
#

uhh not that

#

uhh help

#

!d help

unkempt canyonBOT
#

help([object])```
Invoke the built-in help system. (This function is intended for interactive use.) If no argument is given, the interactive help system starts on the interpreter console. If the argument is a string, then the string is looked up as the name of a module, function, class, method, keyword, or documentation topic, and a help page is printed on the console. If the argument is any other kind of object, a help page on the object is generated.

Note that if a slash(/) appears in the parameter list of a function when invoking [`help()`](https://docs.python.org/3/library/functions.html#help "help"), it means that the parameters prior to the slash are positional-only. For more info, see [the FAQ entry on positional-only parameters](https://docs.python.org/3/faq/programming.html#faq-positional-only-arguments).

This function is added to the built-in namespace by the [`site`](https://docs.python.org/3/library/site.html#module-site "site: Module responsible for site-specific configuration.") module.
slate swan
#

bro

final iron
#

What are you looking for

slate swan
#
@commands.has_permissions(manage_channels=True)
#

all the has permisisons thign

final iron
#

!d discord.ext.commands.has_permissions

unkempt canyonBOT
#

@discord.ext.commands.has_permissions(**perms)```
A [`check()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check") that is added that checks if the member has all of the permissions necessary.

Note that this check operates on the current channel permissions, not the guild wide permissions.

The permissions passed in must be exactly like the properties shown under [`discord.Permissions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions "discord.Permissions").

This check raises a special exception, [`MissingPermissions`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.MissingPermissions "discord.ext.commands.MissingPermissions") that is inherited from [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure").
slate swan
#

ty

brave flint
#

um

#

did someone know

final iron
unkempt canyonBOT
#

property id```
Equivalent to [`User.id`](https://discordpy.readthedocs.io/en/master/api.html#discord.User.id "discord.User.id")
brave flint
#

like that right?

#

i think i dont mess with that line

final iron
#

Not discord.member

brave flint
#

thx

pine pond
#

ANSI style code-blocks in discord still don't work on mobile (on the desktop version it works). Does anyone know when it will or where I can stay up to date?

honest vessel
#

@slate swanur a clown who needs help with someones else code that is doing harm to discordservers

#

scriptkiddie

polar ice
#

Hello, How would to check if user has admin role in guild for a command?

I tried this but its working for everyone.

    if interaction.custom_id == 'delete_kill':
        administrator_role = discord.utils.get(interaction.guild.roles, name="Administrator")

        if administrator_role.id == server_settings[interaction.guild.id]['admin_id']:  # Check if this role is in the member's roles
            await interaction.respond(type=6)
            print(f"{interaction.author.name} has admin role id: {server_settings[interaction.guild.id]['admin_id']}")
            await interaction.message.delete()```
slate swan
#
if Role in Member.roles
``` can be used to check if a member has the role or not
hoary cargo
#

PopcornPepe how many shards are recommended to have for bots that are in ~2,5 - 3k servers

round widget
#

is there some routine that'd let me get list of everyone who reacted to a message?

#

discord.py used to have get_reaction_users coroutine but I don't see it in the docs anymore

unkempt canyonBOT
#

async for ... in users(*, limit=None, after=None)```
Returns an [`AsyncIterator`](https://discordpy.readthedocs.io/en/master/api.html#discord.AsyncIterator "discord.AsyncIterator") representing the users that have reacted to the message.

The `after` parameter must represent a member and meet the [`abc.Snowflake`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Snowflake "discord.abc.Snowflake") abc.

Examples

Usage

```py
# I do not actually recommend doing this.
async for user in reaction.users():
    await channel.send(f'{user} has reacted with {reaction.emoji}!')
```...
round widget
#

thanks!

quick gust
pine pond
edgy lion
#
 @commands.Cog.listener()
    async def on_message(self, message):
        if message.author.bot:
            return
        if isinstance(message.channel, discord.channel.DMChannel):
            print('ok')``` why didn't the bot print anything even though i wrote a dm to the bot
slate swan
#

yep , thats a small walkthrough about how to use them , None of us have an idea when it would get added on mobile

#

and if im not wrong , only python nd rust markdown are currently supported

quick gust
#

!d discord.Message.add_reaction || @round widget

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.
pine pond
slate swan
round widget
#

thanks @quick gust

quick gust
#

np

pine pond
#

In case you are on mobile

slate swan
round widget
#

@quick gust but when I do this, I get

attribute 'add_reaction' ```
quick gust
#

message is none

pine pond
#

Oh I misread your answer my bad

slate swan
#

lemme check js

#

yea it is supported

round widget
quick gust
#

can you show the entire code?

round widget
# quick gust can you show the entire code?

msg = await inter.response.send_message(embed=embed)
await msg.add_reaction("βœ…")

is this enough? cause I got a ton of embed lines in the code that don't mean a thing

quaint scaffold
#

yes but why are you randomly indenting after the msg =

round widget
#

I think it's just discord format

#
        await msg.add_reaction(":white_check_mark:")```
#

this is how the code looks actually

#

I forgot to add backticks in original msg, there's no await indent

quaint scaffold
#

That won't work

slate swan
#

the emoji

#

must be copy pasted or unicodes

round widget
#

oh

slate swan
#

yeah

#

Mr. Dan may continue, sorry for interrupting

quaint scaffold
#

lmao no, please do help

round widget
#

gonna look for unicodes then, as I cna't really copy paste it to my editor

quaint scaffold
#

The more the merrier

oblique cobalt
#

at start*

round widget
#

oh thanks

#

had no idea <3

oblique cobalt
#

np

slate swan
quaint scaffold
round widget
#

thanks ashley, dan

quaint scaffold
#

That was all ashley hapy

slate swan
slate swan
quaint scaffold
oblique cobalt
slate swan
maiden fable
#

Rip my tag πŸ₯²

slate swan
maiden fable
#

Discriminator

slate swan
#

aw

slate swan
maiden fable
#

Had nitro, just expired πŸ€·β€β™‚οΈ

maiden fable
#

Bots have pseudo nitro

slate swan
forest beacon
#

Not sure if anyone remember or even cares but in case someone is dealing with the same problem here: I was trying to loop through channels to lock down a server. My problem was I was using guild.channels when I could’ve been using guild.text_channels. The code would run then hang up on voice channels and abort mission.

maiden fable
slate swan
maiden fable
#

!d discord.Role.edit

unkempt canyonBOT
#

await edit(*, name=..., permissions=..., colour=..., color=..., hoist=..., mentionable=..., position=..., reason=...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Edits the role.

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

All fields are optional.

Changed in version 1.4: Can now pass `int` to `colour` keyword-only parameter.

Changed in version 2.0: Edits are no longer in-place, the newly edited role is returned instead.
maiden fable
#

!d discord.Guild.default_role

unkempt canyonBOT
maiden fable
#

Just set the permissions that no one can send messages

quaint scaffold
forest beacon
maiden fable
forest beacon
maiden fable
#

Haha

#

BTW editing the role is better imho since u can't go on calling the API for every. single. channel.

forest beacon
forest beacon
quaint scaffold
slate swan
forest beacon
#

This is what I got working


    @commands.command()
    @commands.has_permissions(manage_channels=True)
    async def lock_server(self, ctx):
        for channel in ctx.guild.text_channels: 
            await channel.set_permissions(ctx.guild.default_role, send_messages=False)
            await channel.send('This channel has been locked down')
        await ctx.send('Server is locked down')```
#

Indent might have messed up, on mobile.

slate swan
#

anyways, best of luck finding the solution

quaint scaffold
quaint scaffold
maiden fable
#

Hmm

maiden fable
quaint scaffold
#

yes

#

Though you don't need to do every channel tbf

maiden fable
#

Rip your bot