#discord-bots

1 messages · Page 619 of 1

slate swan
#

I still dont find it interesting idk why

sick birch
#

I was really into it, it felt really OOP-y to me and I was a big fan of that haha

slate swan
#

Thats funny

#

Ive always been told to do a a custom help command cuz of "customization"

#

Oh yeah sorry for not saying it earlier but @sick birch great to see you pithink

sick birch
novel bolt
#

i am new to slash commands so i was trying with shash commands examples , so it was working when guild id is given

#

so can we do without it?

#

is there any way

sick birch
#

What is "it"?

novel bolt
#

slash commands

sick birch
#

You'll have to be more specific

#

What library are you using?

novel bolt
#

discord slash

sick birch
#

And how did you provide guild ID? i'm pretty sure that's not an option

slate swan
#

you can do that without providing a guild id , but it will take around 2hrs to get itself registered

sick birch
#

Oh i see

slate swan
#

Great to see you here too @slate swan

novel bolt
sick birch
#

Yeah for testing purposes do it guild only, for public changes do it without a guild id

slate swan
#

*them = the time

novel bolt
#

like this

sick birch
#

providing a guild id is almost instantaneous

#

suited for quick testing

slate swan
#

Love to see all the regulars here always like to be nice and greet thempithink

novel bolt
slate swan
# novel bolt how to do it?

basically , you just remove the guild_ids parameter

If you remove it , the command gets added globally ( i.e. in every server your bot is in) , it takes around 2hrs for this process to complete

#

If you use guild_id , as you are doing rn
The command gets added in the guild whose Id you provided , it takes no time to get added in this case

novel bolt
slate swan
novel bolt
#

mine is just for my server so ..

slate swan
#

Are you making the bot/slash command for a single guild?

novel bolt
novel bolt
slate swan
slate swan
novel bolt
slate swan
#

In most of the libraries you can add the guild ids to your bot object instead of adding them in every command

slate swan
visual island
sick birch
#

it doesn't matter if the bot is online or not, it's just a post request at the end of the day

#

it has nothing to do with your bot's gateway status

slate swan
slate swan
novel bolt
#

oh nice

slate swan
#

Is the gateway the connection the user has with the discord api?

sick birch
#

correct

slate swan
#

Ah i see 🤔

sick birch
#

it's at it's core a websocket connection

slate swan
#

Yea basically the sharing of data ( recieving events and making reqs ) happens with it

sick birch
#

it's basically a discord for discord

slate swan
#

Gateways are Discord's form of real-time communication over secure WebSockets. Clients will receive events and data over the gateway they are connected to and send data over the REST API
According to docs

sick birch
#

the server and your client can talk to each other in real time

slate swan
#

Thx for both of you🤔

distant warren
sick birch
#

gateway - events
the api - fetching messages, guilds, user data, etc

maiden fable
#

Yes

slate swan
#

Thank you @sick birch and @slate swan very professional 🤔

slate swan
slate swan
slate swan
maiden fable
#

Lmao

slate swan
sick birch
slate swan
#

(Marvel reference)

maiden fable
#

Damn bro you all pros

slate swan
#

Not me

#

Yes im pro level programmer continues to compare a int with a list

unkempt jewel
#

WHY it showed me this

#

i created the command!

slate swan
#

could you show the command's code and the cog

unkempt jewel
#

sure

slate swan
unkempt canyonBOT
#

Hey @unkempt jewel!

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

slate swan
unkempt jewel
#

yea

#

i restarted it many times

slate swan
#

And is the cog loaded?

unkempt jewel
#

yes

slate swan
#

I wanted to duplicate a channel in my guild so I made thispy g=ctx.guild for c in g.channels: if c.name=="staff": ch=await g.create_text_channel(name=f"copy-{c.name}")

How can I copy every role permission from my old channel to new channel??

unkempt jewel
#

its loaded

slate swan
unkempt jewel
#

uhm can u guys help me ://

slate swan
#

And use it inside it

gloomy quest
#

Hi

slate swan
gloomy quest
#

how to ummmmmmmmmmm

unkempt jewel
gloomy quest
#

make a ummmm

unkempt jewel
#

me

gloomy quest
#

music bot

gloomy quest
quick gust
#

@unkempt jewel seems like you have 2 Card cogs?
Cards and Card2

slate swan
gloomy quest
quick gust
#

and the Card cog hasn't really loaded

unkempt jewel
#

i dont use the first card

gloomy quest
#

help me

#

I need to make a music bot

#

but i c a n t

unkempt jewel
#

youtube :v

slate swan
gloomy quest
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)
near sail
gloomy quest
slate swan
quick gust
gloomy quest
#

o k

#

r i p music

slate swan
#

Just use something else

unkempt jewel
slate swan
quick gust
slate swan
slate swan
quick gust
near sail
unkempt jewel
#

i got collect here

slate swan
#

I dont get it 😭

#

Like i know it does send but why???

#

!e py m = print("like this")

unkempt canyonBOT
#

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

like this
slate swan
#

I thought it was cause its a coroutine but idk

slate swan
#

the line is interpreted and executed rather than just assigning the value

#

My life is a lie

#

MY LIFE IS A LIE I THOUGHT THAT WAS NEVER POSSIBLE😭

#

yert pip install -U life

slate swan
#

Great

slate swan
near sail
slate swan
distant warren
slate swan
dapper cobalt
slate swan
slate swan
slate swan
unkempt jewel
#

yo im waiting for help ._.

slate swan
#

Kinda slow and badjam_cavedude pithink

unkempt jewel
#

still waiting...

slate swan
#

Jk

unkempt jewel
#

okimii help ._.

slate swan
#

Simply how can I get permissions of each role from a specific channel

slate swan
slate swan
unkempt canyonBOT
#
I don't think so.

No documentation found for the requested symbol.

slate swan
#

Why wait

unkempt jewel
slate swan
unkempt jewel
#

str(2)

#

:D

#

idk why my bot get errors

visual island
unkempt canyonBOT
#

permissions_for(obj, /)```
Handles permission resolution for the [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") or [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role").

This function takes into consideration the following cases...
unkempt jewel
#

Ignoring exception in command None:
discord.ext.commands.errors.CommandNotFound: Command "collect" is not found

slate swan
#

Oh ye

slate swan
unkempt jewel
slate swan
#

!d discord.TextChannel.overwrites

unkempt canyonBOT
#

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

This is returned as a dictionary where the key contains the target which can be either a [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role") or a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") and the value is the overwrite as a [`PermissionOverwrite`](https://discordpy.readthedocs.io/en/master/api.html#discord.PermissionOverwrite "discord.PermissionOverwrite").
slate swan
#

Ok here is my code of what am I doing py for g in Blank.guilds: if f"copy - {ctx.guild.name}" in g.name: for c in g.channels: await c.delete() for cate in ctx.guild.categories: x = await g.create_category(f"{cate.name}") for chann in cate.channels: if isinstance(chann, discord.VoiceChannel): await x.create_voice_channel(f"{chann}") if isinstance(chann, discord.TextChannel): await x.create_text_channel(f"{chann}") for roles in ctx.guild.roles: await g.create_role(name=roles.name, colour=roles.colour, permissions=roles.permissions) try: await g.edit(icon=requests.get(ctx.guild.icon_url).content) except Exception: pass

ctx.guild is the original guild

unkempt jewel
visual island
slate swan
#

See icy is smarteryert

slate swan
#

This is what I am trying to do

#

it works fine

visual island
unkempt jewel
slate swan
#

😉

slate swan
slate swan
unkempt jewel
slate swan
unkempt jewel
#

if im smart i wont be here to ask :?

quick gust
#

let's not go ot

slate swan
slate swan
unkempt jewel
#

for help me :vvv

visual island
unkempt canyonBOT
#

add_cog(cog, *, override=False)```
Adds a “cog” to the bot.

A cog is a class that has its own event listeners and commands.

Changed in version 2.0: [`ClientException`](https://discordpy.readthedocs.io/en/master/api.html#discord.ClientException "discord.ClientException") is raised when a cog with the same name is already loaded.
visual island
#

and load_extension

unkempt jewel
#

h o w

slate swan
unkempt jewel
quick gust
#

your main file

#

have you not already did that?

slate swan
#

Irrc bot.add_cog(cogname())

slate swan
unkempt jewel
unkempt jewel
quick gust
#

sigh

quick gust
slate swan
quick gust
slate swan
unkempt jewel
#

or i will put it in line 1

slate swan
visual island
slate swan
#

Misa already has it

#

No like this:

bot.add_cog(cogname())
bot.run("")
slate swan
unkempt jewel
#

still not work

slate swan
unkempt jewel
#

so

slate swan
#

or , you need to import the Cog class from the cog file and use the method you told

unkempt jewel
#

how can i fix this, can u fix this for me :)

slate swan
slate swan
unkempt jewel
#

all the commands be ignored

slate swan
#

( events I said , not listeners)

slate swan
slate swan
slate swan
#

I do know how to i just find them over complicated and never do them😭

slate swan
slate swan
#

@slate swan How to get role from name?? (any other way than discord.utils??)

slate swan
#

ook

#

Im just to lazy to do cogs yert

#

shipit I was too , but when my main file crossed 2000+ lines it was hard to handle and fix stuff

slate swan
#

Like being efficient

slate swan
#

I tried cogs inside main file once , just to make the help command a bit less uglier

slate swan
slate swan
slate swan
visual island
slate swan
#

but yes since the bot is online , sure

#

@slate swan Do you think if this would work for the roles stuff I was doing before?? py for channel in ctx.guild.channels: ch=discord.utils.get(g.channels, name=channel.name) for role in ctx.guild.roles: nr=discord.utils.get(g.roles, name=role.name) ch.permissions_for(nr)=channel.permissions_for(role)

#

Cogs scare me for no reason grumpchib

visual island
slate swan
#

Regenerate your token

near sail
#

@slate swan You just leaked your token regenerate it

slate swan
visual island
#

@slate swan what library are you using?

slate swan
slate swan
visual island
#

well, firstly we can't help you if you don't even know what lib you're using

slate swan
#

We cant even see your error anymoreyert

slate swan
visual island
slate swan
#

Can anybody please explain whats a property in the dpy docs i kinda dont know cuz i knew but i forgot cause the answer wasnt clear

slate swan
slate swan
#

Ah i see🤔

boreal ravine
unkempt canyonBOT
#

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

1
boreal ravine
#

it's a property of the class, it doesnt take any arguments/parameters

maiden fable
#

Imagine not using capital letters for class names ;-;

slate swan
maiden fable
#

Good*

slate swan
#

Goose 😳

maiden fable
#

Lmao

slate swan
slate swan
slate swan
boreal ravine
fair axle
#

i just realized we are all indians so the same people meet at the same time

#

well most of us

slate swan
#

I wish i was

slate swan
#

I love my indians bros ngl

visual island
# slate swan Can anybody please explain whats a ```property``` in the dpy docs i kinda dont k...

What's a property?
A property is a method/attribute from a class which must return/yield value(s).

What makes it different from normal attribute?
For example I have a bot "icy" which I store the name in class Foo

Normal attribute:

class Foo:
  def __init__(self):
    self.name = bot.user.name
a = Foo()
print(a.name) # icy
# then if I for example edit the bot name to "someone" then self.name is not updated
print(a.name) # still icy

Property:

class Foo:
  @property
  def name(self):
    return bot.user.name
a = Foo()
print(a.name) # icy
# then if I for example edit the bot name to "someone" then self.name is not updated
print(a.name) # someone

something like that

maiden fable
#

Not most but okay

#

I wrote an article about it 🤣

slate swan
#

lmao hunter

#

Even if its from docs😭

maiden fable
maiden fable
slate swan
visual island
maiden fable
#

Yea yea

visual island
maiden fable
#

Welp, bot still not up ;-;

#

I hate Gateway Timeout errors

visual island
slate swan
#

You guys are all fun to talk to nglyert

visual island
maiden fable
slate swan
boreal ravine
fair axle
#

.-..-...(imagine these as beats and tell me what it is)

slate swan
maiden fable
visual island
maiden fable
slate swan
maiden fable
slate swan
#

Im stupidyert

#

How active chat

#

@slate swan is cool cuz hes just meh a normal human

maiden fable
visual island
fair axle
slate swan
boreal ravine
maiden fable
slate swan
slate swan
slate swan
#

😭

maiden fable
#

Anyways it's all OT

visual island
#

time to eat brb

maiden fable
#

!ot please

unkempt canyonBOT
slate swan
slate swan
visual island
slate swan
#

What is this?

maiden fable
#

don't y'all think this is becoming more OT talks

maiden fable
#

Then think like that (:

slate swan
#

Xd

#

yert Anyways cya guys. , I need to get my admit card today lol

slate swan
slate swan
slate swan
maiden fable
#

!pypi life

unkempt canyonBOT
maiden fable
#

Kk

slate swan
#

How active server

slate swan
maiden fable
slate swan
maiden fable
#

Mhm

slate swan
slate swan
#

Weird myxi isnt here🤔

slate swan
#

Than your car

boreal ravine
#

!ot

unkempt canyonBOT
maiden fable
#

@sullen shoal @slate swan is missing you

maiden fable
slate swan
#

My finger slipt

slate swan
maiden fable
slate swan
slate swan
#

Please no one ss😭

slate swan
#

I wanna make a bot count how many strokes i have a day how may i start?

#

Strokes?

slate swan
quick gust
#

use Arduino

slate swan
quick gust
#

:)

slate swan
#

Use a db to store the data, make a command that increments the value in the db by 1 everytime you use it, and you're done

#

Should i add a except if i die?

#

Maybe make it give a little feedback too to let you know that you had a stroke just in case you forget

slate swan
quick gust
#

who said that

slate swan
#

Okimii

#

That's what he asked for lmao

slate swan
quick gust
#

I want it to automatically check for my strokes using a sensor

slate swan
#

Yeah

slate swan
#

:kek: 😔

#

😔

#

What if i call the api(my heart) and i call it to much will it stop my strokes?

#

There's 8 kids and first class started 😭

slate swan
#

😔✌️

slate swan
#

:kek:

sullen shoal
#

hm i got a notification

slate swan
slate swan
#

Cause im a freshmanyert

sullen shoal
#

hello okimii

slate swan
slate swan
sullen shoal
#

oh

slate swan
#

Ship

sullen shoal
#

hello pablo

slate swan
slate swan
slate swan
sullen shoal
#

wtf

slate swan
#

😔

#

¯\_(ツ)_/¯

sullen shoal
#

alright i gotta eat my chocolate before it melts

slate swan
#

:kek:

sullen shoal
#

this chocolate is mine

slate swan
#

It's fine I hate chocolate anyways 😎

#

@slate swan rate the name?

slate swan
#

You like nutella dont youlemonpeek

#

No

#

I don't like any kind of chocolate

#

Well, kinder is an exception

#

What kid doesnt like that lmfao

#

:kek:

#

Im to mature for a kinderpithink
eats kinder

#

You're never too mature to eat a kinder 🍫 😎

boreal ravine
#

Bruh

#

!ot this isn't off-topic

unkempt canyonBOT
slate swan
slate swan
slate swan
slate swan
slate swan
visual island
#

I thought kinder is for < 12 ADthink

slate swan
slate swan
#

Kinder is all ages 😌

#

TAKE THAT BACK NOWjam_cavedude

boreal ravine
slate swan
sullen shoal
#

tbh idek what chocolate i eat, i just eat them

boreal ravine
slate swan
#

Lol

visual island
visual island
#

like it's name speak for itself

slate swan
#

💀

slate swan
visual island
slate swan
#

Anybody uses to sniff fundipyert

sullen shoal
#

is kinder that thing with two small brown balls

slate swan
visual island
#

kinder is for five lol

slate swan
#

Say it with me guys

visual island
slate swan
slate swan
visual island
sullen shoal
#

oh thats kinder joy

visual island
#

everyone bullies me

slate swan
#

!e

print("icy just eat a kinder youll feel better")
unkempt canyonBOT
#

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

icy just eat a kinder youll feel better
slate swan
#

Yes

visual island
#

I ate it once..

slate swan
#

Definitely

#

If you didnt ate it so quickly like no one is gonna steal it from you

visual island
#

I ate the toys

slate swan
#

okimii has left the chat

visual island
#

icy has left the chat

slate swan
#

okimii has joined the chat

#

Bmx bike >>> any kinder egg toy

sullen shoal
#

the error says it all

slate swan
#

I think you cant iterate a property

sullen shoal
#

then listen to it

slate swan
#

Funny guy isnt he

#

Ngl replit in mobile looks so cursed to me

sullen shoal
#

discord.Guild.members is a property

slate swan
#

Yes.

sullen shoal
#

!d discord.Guild.members

unkempt canyonBOT
#

property members: List[discord.member.Member]```
A list of members that belong to this guild.
slate swan
sullen shoal
#

although i never saw that error and it shouldn't either, looks like you have to use iter function over it

visual island
#

it should, he is trying to get the property from a class not an instance, which will never work

sullen shoal
#

oh so they're one of those people

visual island
#

mhm

slate swan
#

Should i get discord nitro?lemonpeek

#

Just random question

visual island
#

if you want to shrug

sullen shoal
#

yeah if you want to

slate swan
#

😭

slate swan
#

wallet = []yert

sullen shoal
#

tbh im already happy with the tag i got after my nitro ended and that's the only thing i like about nitro so now i dont need to buy nitro

visual island
visual island
#

oh yeah, time to change my tag

slate swan
visual island
#

what is self.guild

slate swan
#

What's self.guild

#

😭

visual island
slate swan
#

Bro wtf

#

Wdym u don't know

#

Kraots == icy??!??!

#

Just saying kraots has better grammar yert

slate swan
slate swan
#

??

#

So it's not your code

visual island
slate swan
#

Do you have any idea what you're doing

slate swan
slate swan
#

Then where did self.guild come from

slate swan
#

And where are you defining what self.guild is

#

Just gonna say it is that mario as your pfp?

#

I don't see any "guild" keyword there

lament mesa
#

show the code for the cog

sullen shoal
#

i dont see self.guild there

slate swan
#

Makes sense

visual island
slate swan
slate swan
#

😎

#

Deep down

#

Then we can't help you

visual island
sullen shoal
#

dont you gave the code on replit

slate swan
slate swan
#

Maturing is realizing that everyone is a kid deep down

sullen shoal
#

imagine not paying for vps but replit hacker plan

slate swan
#

Ikr 💀💀

slate swan
slate swan
sullen shoal
#

okay so its private only for 6 months

visual island
#

im an exception tho

maiden fable
#

pithink tf is going on here

visual island
slate swan
#

No one is

slate swan
slate swan
visual island
slate swan
maiden fable
slate swan
#

✌️

maiden fable
slate swan
sullen shoal
#

i gotta go back to making my discord api wrapper

#

cya

slate swan
#

Or maybe he just really likes mc :kek:

visual island
sullen shoal
slate swan
#

😳

slate swan
slate swan
slate swan
#

:kek:

visual island
#

:kek:

slate swan
#

:kek:

sullen shoal
#

:kek:

maiden fable
#

Best of Luck Myxi!

sullen shoal
#

thanks!

#

i got the two loops running one of which is the heartbeat thing now idk what to do with the recommended shards

maiden fable
#

Hmm

visual island
#

shards and keep alive (heartbeat) are the hardest to implement imo

sullen shoal
#

indeed

novel bolt
#

why is this error happening when i added slash command

slate swan
#

It clearly tells you that you can't have duped slash commands (slash with the same name)

sick talon
novel bolt
#

same name as that of commands?

slate swan
#

No, same name as that of other slash commands that you have in your bot

slate swan
unkempt canyonBOT
#

discord_slash/client.py lines 93 to 96

if not hasattr(self._discord, "slash"):
    self._discord.slash = self
else:
    raise error.DuplicateSlashClient("You can't have duplicate SlashCommand instances!")```
visual island
#

it's not meant for duplicate commands

shell island
#

don't use light theme the error will go away

slate swan
#

Red text on white is really shit

novel bolt
#

😓

visual island
#

@novel bolt do you have 2 external libs or something?

celest ember
#

hey can anybody help me in python i am new to it

visual island
novel bolt
visual island
novel bolt
#

oh so that was teh prob

visual island
#

mhm

novel bolt
#

i used dislash for buttons

visual island
#

so use dislash for slash commands also then

novel bolt
#

oh ok thank you

slate swan
#

Im goind to sleep gn guys love you all

visual island
#

gn

novel bolt
#

i used dislash coz in discord components i saw interactiont type removed

visual island
#

you dont actually need external libs anymore, there are many discord.py forks that have implemented everything

slate swan
#

Like disnake, best fork

maiden fable
novel bolt
#

oh

#

i have disnake

#

ok them imma use it

slate swan
#

Make sure you uninstall dpy and other 3rd party libs

slate swan
#

Yes

novel bolt
#

lol

slate swan
#

Could cause conflicts, seen it happen before somehow

maiden fable
#

So that it doesn't conflict with the namespace, yes

slate swan
#

Cause i have disnake and dpy and it works fine

slate swan
#

Bye nowyert lemonpeek

novel bolt
#

i will try , by not importing the other lib

#

and check

boreal ravine
slate swan
#

Oh 💀💀💀

rocky mist
#

can any1 explain?

#

im new at this @@@@

boreal ravine
rocky mist
maiden fable
maiden fable
boreal ravine
sick talon
rocky mist
maiden fable
rocky mist
#

im new sorry

visual island
maiden fable
#

It's fine

maiden fable
# visual island yeah

Ah, hmm. I would instead prefer a while loop with an asyncio.sleep(10) at last haha

#

That's what I do in my wrapper 🤷‍♂️

visual island
maiden fable
#

Why not a simple one, like every x seconds or something 🤦

maiden fable
#

Eh, they weird tbh

#

Anyways, I should be getting a reply from discord ASAP tbh.. Since, well, I haven't heard from them since a week or something

#

On my bot verification

#

Let's hope for the best

visual island
maiden fable
#

I never "prayed" for anything, but I don't have much expectations

#

Since most are small servers

#

But let's hope for the best, shall we :D

visual island
#

who knows if the staff accidentally pressed "verify" button

maiden fable
#

Ye, let's hope that happens 🥺

visual island
#

lol 🙏

slate swan
#

any

#

good tut?

boreal ravine
#

yes

slate swan
#

thank

#

you

#

too

#

much

stark lily
#

Whatttt

slate swan
boreal ravine
#

Sure

hollow agate
#
@client.command()
async def mute(ctx, member: discord.Member, time=None, *, reason=None):
    format = datetime.now(tz=pytz.timezone('America/Tijuana'))
    formatted = format.strftime("%I:%M %p")
    b = DT.datetime.now().timestamp()
    modlogs = client.get_channel(872909569196707870)
    db = await aiosqlite.connect('database.db')
    cursor = await db.execute('SELECT * FROM mutes')
    rows = await cursor.fetchall()
    muted = discord.utils.get(ctx.guild.roles, name="Muted")
    farmer = discord.utils.get(ctx.guild.roles, name="Farmers")
    apprentice = discord.utils.get(ctx.guild.roles, id=907127783849861120)
    if ctx.message.author.guild_permissions.administrator:
        if member is None:
            e = await ctx.reply('You must mention someone to mute!')
            await asyncio.sleep(5)
            await e.delete()
            await ctx.message.delete()
            return
        if time is None:
            a = await ctx.reply('Please state a time for a timed mute or a reason for a permanent mute!')
            await asyncio.sleep(5)
            await a.delete()
            await ctx.message.delete()
            return
        if reason is None:
            if time[-1] in ['s', 'm', 'h', 'd']:``` This is quite messy, but is there a way that I can somehow determine if the `s`, `m`, `h`, and `d` are touching another letter, if so it does something?

```py
            if time[-1] in ['s', 'm', 'h', 'd']:``` after this line of course.
slate swan
#

what i mean by that is (synonyms: word, word, word and so on)

sullen shoal
#

synlist = ', '.join(synlist)
one way would be to do something like,

', '.join([... for word in synlist])```
sullen shoal
#

word will be each element of the list

slate swan
#

', '.join([... for word in synlist]) what else do i put before the word part

sullen shoal
#

you gotta think about that, im not spoonfeeding that much

slate swan
#

ok

sullen shoal
#

my bot is now online yoooooooo

boreal ravine
prisma spoke
#
@client.command()
async def embed(ctx,*,title,description,url):
    await ctx.send("Enter the Title for the Embed")
    def check(msg):
        return msg.author == ctx.author and msg.channel == ctx.channel
    msg = await client.wait_for("message", check=check)
    if msg.content.lower() == "none":
        await ctx.send("There should be a title argument, Please use the command again!")
        return
    elif await ctx.send("Enter the description for the Embed"):
        if msg.content.lower() == "none":
            await ctx.send("There should be a description argument, Please use the command again!")
            return
            
    elif await ctx.send("Enter an url for the image or write `None` to skip"):
        if msg.content.lower() == "none":
            embed = nextcord.Embed(title=title, description=description, color=0xA020F0)
            await ctx.send(embed=embed)
        else:
            embed=nextcord.Embed(title=title, description=description)
            embed.set_image(url=url)
            await ctx.send(embed=embed)```
` i wnt that bot shud ask user for title desc and url, heres what i got can someone help me in this?
sullen shoal
#

whats the error

tropic briar
#

I wanna make the fields in a list like that of @unkempt canyon

slate swan
#

How to make a command specific to a channel?

tropic briar
#

How 🤔

sullen shoal
#

!d discord.Embed.add_field

unkempt canyonBOT
#

add_field(*, name, value, inline=True)```
Adds a field to the embed object.

This function returns the class instance to allow for fluent-style chaining.
sullen shoal
#

use inline as False

boreal ravine
boreal ravine
slate swan
# boreal ravine Check for the channel id/name
@client.command()
@commands.has_permissions(manage_messages=True)
async def session(message, ctx, info, *, name):
    if message.channel.id == 912962943484066367:
        mes = await ctx.send(f'**{ctx.author.mention} is hosting:**\n*Info: {Info}\Name: {Name}\nDate: {datetime.datetime.today().weekday()}*\n*Please react to this message if you plan on joining today! See you all there!*')
        await mes.add_reaction(":heavy_check_mark:")
#

@boreal ravine

#

or wait

boreal ravine
prisma spoke
#

i have error handler

slate swan
boreal ravine
#

for commands, dont use on_message

prisma spoke
boreal ravine
slate swan
slate swan
sullen shoal
#

currently, message is the Context

#

ctx an argument

boreal ravine
slate swan
#

I have a python code in my github encrypted as base64

When I print it using b64decode, requests.get....I get the string which also contains escape sequence....How can I fix it

boreal ravine
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
prisma spoke
boreal ravine
shadow wraith
#

does discord_slash work for cogs?

slate swan
#
@client.command()
@commands.has_permissions(manage_messages=True)
async def session(ctx, info, *, name):
    if ctx.channel.id == 912962943484066367:
        mes = await ctx.send(f'**{ctx.author.mention} is hosting:**\n*Info: {Info}\Name: {Name}\nDate: {datetime.datetime.today().weekday()}*\n*Please react to this message if you plan on joining today! See you all there!*')
        await mes.add_reaction(":heavy_check_mark:")
```?
#

Im a little confused here, @boreal ravine I understood that message wouldnt go as the first parameter because its not the context

boreal ravine
prisma spoke
boreal ravine
boreal ravine
shadow wraith
#

tip: ctx can't be used in events 🚎

slate swan
sullen shoal
#

you can get Context, if you want

shadow wraith
#

i use commands.Context for no reason

boreal ravine
prisma spoke
shadow wraith
#

if ctx can be used how tf do i ditch message.channel.send 💀

boreal ravine
rotund nova
#

bot don't give role and don't send message

#

In cmd nothing

boreal ravine
unkempt canyonBOT
#

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

Returns the invocation context from the message.

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

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

wtf is this

sullen shoal
#

gets you the context

boreal ravine
sullen shoal
#

not really worth it tbh

boreal ravine
tropic briar
#
 @bot.event
async def on_message(message):
  await bot.handler.propagate(message)
  await bot.process_commands(message)
  message_split = message.content.split(".")
  for message_word in message_split:
    for bad_word in Filter:
      if(bad_word == message_word.lower()):
        await message.delete()
        await message.channel.send("I have deleted that message :angry:")
``` I want to give the user Muted role, but how ?
boreal ravine
shadow wraith
sullen shoal
#

when?

boreal ravine
unkempt canyonBOT
#

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

Gives the member a number of [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role")s.

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, and the added [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role")s must appear lower in the list of roles than the highest role of the member.
shadow wraith
#

yea the message above the message above is the right one

#

and give your bot manage_role perms

tropic briar
sullen shoal
boreal ravine
tropic briar
#

To add muted role

slate swan
#
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: type object 'datetime.datetime' has no attribute 'datetime'
prisma spoke
boreal ravine
slate swan
#
@client.command()
@commands.has_permissions(manage_messages=True)
async def session(ctx, info, *, name):
    if ctx.channel.id == 912962943484066367:
        mes = await ctx.send(f'**{ctx.author.mention} is hosting:**\n*Info: {Info}\Name: {Name}\nDate: {datetime.datetime.today().weekday()}*\n*Please react to this message if you plan on joining today! See you all there!*')
        await mes.add_reaction(":heavy_check_mark:")
```?
tropic briar
slate swan
#

import datetime

sullen shoal
#

must be from datetime import datetime; datetime.datetime

boreal ravine
prisma spoke
#

issue

slate swan
boreal ravine
tropic briar
boreal ravine
unkempt canyonBOT
boreal ravine
#

it's an instance of member

tropic briar
#

ohh

sullen shoal
#

i was guessing how youd import it to get that error

slate swan
#
from datetime import datetime; datetime.datetime
AttributeError: type object 'datetime.datetime' has no attribute 'datetime'```
boreal ravine
#

year is a string

sullen shoal
#

!e print(1);print(2)

unkempt canyonBOT
#

@sullen shoal :white_check_mark: Your eval job has completed with return code 0.

001 | 1
002 | 2
slate swan
shadow wraith
#

wait now that i think of it

boreal ravine
sullen shoal
boreal ravine
#

the error in the console?

tropic briar
#
await discord.message.author.add_roles(role)
``` I think it's wrong ![pithink](https://cdn.discordapp.com/emojis/652247559909277706.webp?size=128 "pithink") @boreal ravine
shadow wraith
#

how do i make my bot and it's bad filter look for the filtered words in sentences like for example i have a filtered word called super then how would it delete messages like superb 💀

#

i did get it working for the main words tho

boreal ravine
slate swan
shadow wraith
#

ok but those are only selected words to be blacklisted tho

slate swan
sullen shoal
shadow wraith
#

you guessed what i wanted, but the only issue is that it's only limited to what words to be blacklisted

sullen shoal
#

then what you do you want

tropic briar
#
someone = discord.message.author
someone.add_roles(role)
slate swan
#
import discord
import datetime
from datetime import datetime
from datetime import *
import random
from datetime import timedelta
import asyncio
from discord.ext import commands

@client.command()
@commands.has_permissions(manage_messages=True)
async def session(ctx, info, *, name):
    if ctx.channel.id == 912962943484066367:
        mes = await ctx.send(f'**{ctx.author.mention} is hosting:**\n*Info: {info}\Name: {name}\nDate: {datetime.datetime.today().weekday()}*\n*Please react to this message if you plan on joining today! See you all there!*')
        await mes.add_reaction(":heavy_check_mark:")
boreal ravine
boreal ravine
#

datetime is the module name, datetime is the things in the module

sullen shoal
#

a class

boreal ravine
sullen shoal
#

!d datetime.datetime

unkempt canyonBOT
#

class datetime.datetime(year, month, day, hour=0, minute=0, second=0, microsecond=0, tzinfo=None, *, fold=0)```
The *year*, *month* and *day* arguments are required. *tzinfo* may be `None`, or an instance of a [`tzinfo`](https://docs.python.org/3/library/datetime.html#datetime.tzinfo "datetime.tzinfo") subclass. The remaining arguments must be integers in the following ranges...
shadow wraith
#

no like super is blacklisted word for example and if someone said superb and it isn't in the blacklisted words list (like the url you showed in the example) so how do i make it block every str containing the bad word

tropic briar
boreal ravine
shadow wraith
sullen shoal
#

my code doesnt care about spaces and stuff

#

or anything

shadow wraith
#

but they can be bypassed using plurals or stuff

sullen shoal
#

if it sees super, it will trigger

boreal ravine
# tropic briar no 😅
class Member:
  ...
class Message:
  ...

message.author = Member()
``` eh this is somewhat of an instance but you get what I mean
shadow wraith
#

this is what i mean

sullen shoal
#

fuck is blacklisted but it works with even iwhejejefucksehekekn?

shadow wraith
#

no

tropic briar
shadow wraith
#

saying that also doesn't make the bot delete the msg

sullen shoal
#

then delete it 🤔

boreal ravine
#

!d discord.Message.author <= this is the member instance

unkempt canyonBOT
shadow wraith
sullen shoal
#

!e

words = ("hello\nlol\npenis\nsuper").splitlines()
test_urls = ('wkwneffwfwlol', 'wefewefwfwfwpenis', 'wkejnfwkfsuperfidjndkdkd')
for url in test_urls:
    for word in words:
        if word in url:
            print(f"{url} is blacklisted") 
unkempt canyonBOT
#

@sullen shoal :white_check_mark: Your eval job has completed with return code 0.

001 | wkwneffwfwlol is blacklisted
002 | wefewefwfwfwpenis is blacklisted
003 | wkejnfwkfsuperfidjndkdkd is blacklisted
tropic briar
#

I have no idea what to do with this

sullen shoal
slate swan
#

I've always been a little confused with *. I understand it serves the purpose of allowing multiple words within the parameter but what if you have two different parameters that are gonna have multiple words? I dont know how to exactly explain what i think of it

shadow wraith
boreal ravine
sullen shoal
#

then doesnt that work

sullen shoal
shadow wraith
sullen shoal
#

so what

boreal ravine
sullen shoal
#

explain what even str is for you

shadow wraith
#

idk 6 words 🤔

sullen shoal
#

what

shadow wraith
sullen shoal
#

!e
words = ("hello\nlol\npenis\nsuper").splitlines()
test_urls = ('wkwneffwfwlol', 'wefewesuperpenis', 'wkejnfwkfsuperfidjndkdkd')
for url in test_urls:
for word in words:
if word in url:
print(f"{url} is blacklisted")

unkempt canyonBOT
#

@sullen shoal :white_check_mark: Your eval job has completed with return code 0.

001 | wkwneffwfwlol is blacklisted
002 | wefewesuperpenis is blacklisted
003 | wefewesuperpenis is blacklisted
004 | wkejnfwkfsuperfidjndkdkd is blacklisted
slate swan
# boreal ravine passes all the arguments after something into the parameter before it I guess (i...

what if you have 2 parameters that could potentially have multiple words? For example:

@client.command()
@commands.has_permissions(manage_messages=True)
async def session(ctx, info, *, name):
    if ctx.channel.id == 912962943484066367:
        mes = await ctx.send(f'**{ctx.author.mention} is hosting:**\n*Info: {info}\Name: {name}\nDate: {datetime.today().weekday()}*\n*Please react to this message if you plan on joining today! See you all there!*')
        await mes.add_reaction(":heavy_check_mark:")```

!session 3:00 Pm Mom House
#

How would you setup the * in this situation?

tropic briar
sullen shoal
boreal ravine
tropic briar
slate swan
#

how can i add a cap to a number given in a command

shadow wraith
slate swan
boreal ravine
tropic briar
#

The bot can change roles of a owner ?

boreal ravine
sullen shoal
#

because my current code works for every string containing those characters in a order somewhere in the string

boreal ravine
#

Discord filter is great. Can't even upload images now.

vale wing
#

Bad image then

shadow wraith
#

that it wouldn't work for every word then

#

ye sorry for being stupid to you

#

i'll just blacklist selected words

boreal ravine
sullen shoal
#

what you want then is splitting it by spaces

thick sigil
#

moms basement

shadow wraith
sullen shoal
#

the checking for the blacklisted words in every word of the string

boreal ravine
slate swan
#

whats that?

#

ahh

#

got it

boreal ravine
#

yes

vale wing
#

I suggest to create a custom converter and make the argument optional, in this case it seems like it is one argument made of 2

boreal ravine
#

maybe

shadow wraith
unkempt canyonBOT
#

@copper ore 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!

tropic briar
#
message.author.add_roles(912976244499427339)
``` Why is this not working 😭
shadow wraith
#

idk how to explain this but like instead of 'fuck' you could say 'fu ck'

and if i were to implement it into a list then it'd still wouldn't work

vale wing
boreal ravine
vale wing
#

Instead of just ID

boreal ravine
#

you cant add an int to a member

shadow wraith
#

like bad_words = ['fu ck']

slate swan
#
@client.command()
@commands.has_permissions(manage_messages=True)
async def session(ctx, time, md, *, name):
    if ctx.channel.id == 912962943484066367:
        mes = await ctx.send(f'**{ctx.author.mention} is hosting:**\n*Info: {info}\Name: {name}\nDate: {datetime.today().weekday()}*\n*Please react to this message if you plan on joining today! See you all there!*')
        await mes.add_reaction(":heavy_check_mark:")```
date is just 2?
#

@boreal ravine

boreal ravine
#

wut date pithink

sullen shoal
slate swan
boreal ravine
slate swan
#

I wanted it to print November 24, 2021 or sumthing

shadow wraith
slate swan
#

It just says 2

#

lmao

#

remove weekday()?

tropic briar
slate swan
#

prolly bc of that

boreal ravine
shadow wraith
tropic briar
#
@bot.event
async def on_message(message):
  await bot.handler.propagate(message)
  await bot.process_commands(message)
  message_split = message.content.split(".")
  for message_word in message_split:
    for bad_word in Filter:
      if(bad_word == message_word.lower()):
        await message.delete()
        await message.channel.send("I have deleted that message :angry:")
        message.author.add_roles(912976244499427339)
``` I have this
vale wing
#

@slate swan you want to print a date in certain format right?

boreal ravine
slate swan
vale wing
#

Just use str on it lol if you don't need any formats

boreal ravine
#

!d discord.utils.get

unkempt canyonBOT
#

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

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

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

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

Examples

Basic usage...
tropic briar
#

😵‍💫

vale wing
#

@tropic briar you can get role object by uh message.guild.get_role(id)

shadow wraith
#

my guy do be speaking in emojis

vale wing
#

Message has guild attribute right?

tropic briar
vale wing
#

Sure

tropic briar
boreal ravine
#

!d discord.Message.guild

unkempt canyonBOT
vale wing
#

Then that code is ok

slate swan
#

This ain't js

vale wing
#

Why not just py str(currentDate)

slate swan
#

fock

vale wing
#

Ah yes that's js

slate swan
#

my fault

shadow wraith
# tropic briar huh?

bro here's an example but it's not the complete fix to your thing

@bot.command(aliases=['addrole'])
async def add(ctx, role: discord.Role, user: discord.User):
    await user.add_roles(role)
    await ctx.send(f'added {role}')```
vale wing
#

@slate swan it's just str(date_object)

#

And there's a method to output it in the specific format

boreal ravine
shadow wraith
#

bro that is js 😂

shadow wraith
boreal ravine
#

useless code then?

shadow wraith
#

no

#

its an example to give him a little bit of understanding

#

it's not meant to be used

slate swan
#

nmv im focking stupid

#

ignore

vale wing
tropic briar
boreal ravine
slate swan
#

nothing