#discord-bots

1 messages · Page 512 of 1

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.
boreal ravine
#

!d discord.Embed.set_footer

unkempt canyonBOT
#

set_footer(*, text=Embed.Empty, icon_url=Embed.Empty)```
Sets the footer for the embed content.

This function returns the class instance to allow for fluent-style chaining.
signal canopy
#

it's not an embed

slate swan
#

oh it works

keen comet
#

Im pretty sure the bot create a webhook then send a embed with it
Idk how to do that

left dove
boreal ravine
slate swan
#

more than once in an embed for example

left dove
slate swan
left dove
#

etc etc

slate swan
#

yup

slate swan
#

‎||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||https://khadz.skid.systems/​‌​​‌​​​​‌​‌‌​​‌​‌‌​​‌‌​​‌​‌​‌‌‌​‌​​‌​‌​​‌‌​​‌‌‌​​‌‌​‌​​​‌​​‌​‌‌

#

for example like that ^

keen comet
slate swan
#

alright tysm

boreal ravine
#

@slate swan ur sus

slate swan
slate swan
left dove
slate swan
boreal ravine
left dove
#

man i think we should stop supporting @slate swan

slate swan
#

not at all xd i dont use betterdiscord that is disgusting.

slate swan
slate swan
#

its got nothing to do with betterdiscord

boreal ravine
#

^

slate swan
left dove
#

okok

slate swan
#

u take a pic with sharex and upload.systems will convert it into a link which u can use to send

left dove
#

means am aksing how u got curved edges in embed ??

boreal ravine
#

its the website

left dove
#

oww i though different

slate swan
#

i can change it too watch this

#

‎||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||https://khadz.skid.systems/​‌​‌‌​​​​‌‌​‌‌‌‌​‌​​‌​​​​‌​​‌‌‌​​‌​​​‌​​​​‌‌​​​​​‌​‌​​‌​​‌​​‌‌​​

#

xd

#

pretty cool right?

left dove
#

yea

boreal ravine
#

how do you get an invite code LMFAO

slate swan
boreal ravine
#

o

slate swan
#

yup

left dove
slate swan
#

my other account has nitro boost

#

lol i got nitro boost on this but im waiting for my nitro classic credit to end

left dove
#

u also have nitro

slate swan
#

‎||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||https://khadz.skid.systems/​‌​​‌‌​​​‌​‌​​‌​​‌​​​‌​​​‌​‌‌​‌​​‌​‌​​​​​‌‌​‌‌​‌​‌‌​‌‌‌​​‌​‌​‌​‌

slate swan
slate swan
slate swan
left dove
#

mmm

#

what generate?

#

or code?

#

hmmm we cannot code bot for u

tranquil quest
keen comet
left dove
#

better learn if u got stuck then ask support here

slate swan
#

@left dove how do i use ' in my code without it messing it up

#

nvm i got it

left dove
#

\'

left dove
tranquil quest
left dove
#

masters never help

tranquil quest
#

you are master

left dove
#

no am moderate

tranquil quest
dapper cobalt
left dove
boreal ravine
slate swan
keen comet
#

But idk

slate swan
#

oh, how come?

boreal ravine
#

u can only set ur bots status to offline, dnd, idle, online

#

anything else u cant i think

hasty iron
#

but shouldnt

keen comet
hasty iron
#

its a discord bug

slate swan
#

oh

hasty iron
#

and requires you to monkeypatch stuff

high flame
#

so i'm using logging module to log some errors/info in runtime how do i disable the logs from discord.py lib

hasty iron
#

which if you dont know what you're doing, you can easily break stuff

hasty iron
#

and same for discord.http

high flame
#

alright

slate swan
#

how do you make a bot reply to ur message?

high flame
#

discord.Message.reply

slate swan
#

‎||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||https://khadz.fuckedyourmom.today/​​‌‌​​‌‌​‌‌‌​‌‌​​‌‌‌​‌‌​​‌​​‌​​‌​‌‌​‌​‌‌​‌‌​‌‌​​​‌​‌​​‌‌​‌​‌​‌​‌

#

like this ^

slate swan
#

!d discord.Message.reply

unkempt canyonBOT
#

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

A shortcut method to [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send") to reply to the [`Message`](https://discordpy.readthedocs.io/en/master/api.html#discord.Message "discord.Message").

New in version 1.6.
timber crescent
#

yo can someone help me make consecutive commands

slate swan
#

I'm trying to make a command to put the server tag in someone's nickname ```py
@commands.command(pass_context=True)
@commands.guild_only()
@commands.cooldown(rate=1, per=3)
async def tag(self, ctx, member: discord.Member=None):
if member == None:
member = ctx.author
else:
member = member
await member.edit(nick=f"!📛√Νέο {member.name}")

It works. If someone uses the command like `.tag` it puts it in their nickname and if they do `.tag @member` it changes that members nickname. How can i make it so that  `.tag @member` only works if you have the manage nicknames perm ?
timber crescent
#

kinda like where the first command asks user input then listens for the users next message

#

cant get the part where it detects another message from the user working

slate swan
keen comet
slate swan
valid niche
timber crescent
#

oooooh

valid niche
#

And then a check function to test if they are the same person and also same channel or whatever you want

#

!d discord.Client.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**...
timber crescent
#

tysm TwT

slate swan
keen comet
reef shell
#

!d discord.ext.commands.Context.reply

unkempt canyonBOT
#

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

A shortcut method to [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send") to reply to the [`Message`](https://discordpy.readthedocs.io/en/master/api.html#discord.Message "discord.Message").

New in version 1.6.
slate swan
# keen comet await ctx.reply("example message")

‎||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||https://khadz.skid.systems/​​‌‌​​​‌​‌‌​‌‌‌‌​‌​‌​‌‌‌​‌‌​‌​‌​​‌​​‌‌‌​​‌‌​‌‌​​​‌‌‌‌​‌​​‌‌‌​‌​​

#

tysm it works but how do i make it not mentionable?

valid niche
#

Ah whoops

valid niche
#

!d discord.Message.reply

slate swan
reef shell
valid niche
#

!d discord.abc.Messageable.send

unkempt canyonBOT
#

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

Sends a message to the destination with the content given.

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

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

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

@slate swan .reply is just a shortcut for send and fills in the reference message for you, just set mention_author to false and it works

boreal ravine
#

I mean mention_author=False

reef shell
slate swan
#

ty

#

whats the cmd for sending random messages?

reef shell
#

there is none

valid niche
reef shell
#

you can make one

slate swan
# valid niche Uh?

‎||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||https://khadz.fuckedyourmom.today/​‌​​‌​​​​‌‌​​‌​​​‌‌​​​‌​​​‌‌​‌‌​​‌​‌​‌‌‌​‌​‌‌​​​​‌​​​​​‌​‌‌‌​​​‌

#

like this

valid niche
#

…I don’t get it?

maiden fable
#

!d random.choice

unkempt canyonBOT
#

random.choice(seq)```
Return a random element from the non-empty sequence *seq*. If *seq* is empty, raises [`IndexError`](https://docs.python.org/3.10/library/exceptions.html#IndexError "IndexError").
valid niche
#

You’re just doing a command?

maiden fable
#

U gotta select an option and just send it

valid niche
#

I see nothing random

maiden fable
keen comet
maiden fable
#

Like, see the bolded part

valid niche
#

Oh that

maiden fable
#

Yea haha

valid niche
#

Yeah random module

slate swan
#

so random.choice(**a connection to the server**;**example**) like that?

reef shell
#

you pass a list of strings

#

as a param

valid niche
#

You freak!

slate swan
keen comet
unkempt canyonBOT
#

random.choice(seq)```
Return a random element from the non-empty sequence *seq*. If *seq* is empty, raises [`IndexError`](https://docs.python.org/3.10/library/exceptions.html#IndexError "IndexError").
reef shell
#

so in your case it would be like

random.choice(['**a connection to the server**','**example**'])```
maiden fable
keen comet
valid niche
#

And it should not exist

maiden fable
#

People who move from JS to Python: Yay, Python also has semicolons =D

reef shell
#

C

slate swan
# reef shell so in your case it would be like ```py random.choice(['**a connection to the se...

‎||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||https://khadz.skid.systems/​‌‌​​​‌​​​‌‌‌​​‌​‌​​‌‌​​​‌​‌​​‌‌​‌‌‌‌​‌​​‌‌​​​​‌​‌‌​​​​‌​‌‌‌‌​​‌

maiden fable
#

Bro...

reef shell
#

you did an oopsie

#

use f string

maiden fable
#

U gotta save it to a var

valid niche
#

You forgot to run random.choice

#

Or wait

#

You didn’t eval it

slate swan
#

oh oops

valid niche
#

Dammit autocorrect hates the word eval

maiden fable
#

Lmao

keen comet
#

Lol

maiden fable
#

eval

#

Not mine, hmm. Good tho

valid niche
#

From eval to even to veal to Evan

keen comet
#

Turn off autocorrect

reef shell
keen comet
#

Ez fix

maiden fable
maiden fable
#

🥲

reef shell
keen comet
valid niche
#

Remember, ducks

keen comet
#

👌

valid niche
#

On another note: disthon is coming out very nice already

heavy radish
#

Ahh, Finally my code is organized..

valid niche
#

Current stare of making an event

#

If you don’t pass an argument to the decorator it uses the function name as the event name

heavy radish
#

Isn't Disthon the Library by Arshia??

keen comet
valid niche
heavy radish
#

Nice

keen comet
#

Nice

visual island
valid niche
#

And I’m one of the developers who is working a lot on it

valid niche
valid niche
#

Models are coming

#

I pretty much wrote most of the internals

#

The websocket, handling events, sending stuff to the API

heavy radish
#

Wow

visual island
heavy radish
#

That's Great!!

#

Arshia did say it means alot

valid niche
#

The discord websocket was a pain to get working tho haha

heavy radish
#

Big up on him

heavy radish
#

Lol

valid niche
visual island
visual island
#

the code is still listener potatopopcorn

unkempt canyonBOT
#

discord/client.py line 65

def event(self, event: str = None):```
valid niche
#

Yours is then, not the master branch

vocal plover
valid niche
#

Where the API for sending requests needs to feature all changes every time

#

And that one will change a lot

timber crescent
#
await channel.send('Hello {.author}!'.format(msg))
#

what does the .format do here?

#
        def check(m):
            return m.content == 'hello' and m.channel == channel

        msg = await client.wait_for('message', check=check)
        await channel.send('Hello {.author}!'.format(msg))
valid niche
#

!d str.format

unkempt canyonBOT
#

str.format(*args, **kwargs)```
Perform a string formatting operation. The string on which this method is called can contain literal text or replacement fields delimited by braces `{}`. Each replacement field contains either the numeric index of a positional argument, or the name of a keyword argument. Returns a copy of the string where each replacement field is replaced with the string value of the corresponding argument.

```py
>>> "The sum of 1 + 2 is {0}".format(1+2)
'The sum of 1 + 2 is 3'
```  See [Format String Syntax](https://docs.python.org/3.10/library/string.html#formatstrings) for a description of the various formatting options that can be specified in format strings.
timber crescent
#

ooooooooh tysm

valid niche
#

Tho I like f-strings more

#

!fstring

unkempt canyonBOT
#

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

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

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

keen comet
dusk pumice
#

What is Rich Presence?

valid niche
#

Normally it’s just a presence

visual island
#

!e

def foo():
     return "hi {0}!" 
print(foo().format("Kylee"))
```this is what str.format should be used for
unkempt canyonBOT
#

@visual island :white_check_mark: Your eval job has completed with return code 0.

hi Kylee!
valid niche
#

But rich means it has more details and often is interactive

#

Like on Spotify you can press listen along

#

Or a twitch streamer shows what they are streaming and a join button

#

Some games have that too

#

That’s rich presence

rustic onyx
#

Is there a way in which I could host a bot for free? I'm trying to avoid repl.it though since I run listeners and tasks with .sleep's inside.

dusk pumice
#

ok

#

thanks

valid niche
#

Tho good on you for avoiding replit

rustic onyx
rustic onyx
valid niche
valid niche
reef shell
#

no free host available

valid niche
#

It’s horribly disgustingly bad

rustic onyx
rustic onyx
valid niche
reef shell
#

aws has 1 year free plan

rustic onyx
#

I remembered I used to pay 3 bucks a month for a VPS, I could host like 5 bots or more haha

valid niche
#

Exactly

rustic onyx
valid niche
#

It’s not much

reef shell
#

lmao same

rustic onyx
#

I've crypto and nothing else haha

#

I'm little Wojak

slate swan
#

await ctx.reply(f'it took `{round(bot.latency*1000)}ms` f{random.choice(responses)})', mention_author = False)

keen comet
slate swan
#

why am i getting an error

valid niche
#

I have a vps for 6 a month where I host like 3 discord bots, a Reddit bot, a website with like 20-30TB of traffic a month

rustic onyx
#

Share the error plz

rustic onyx
rustic onyx
#

What VPS are you using?

slate swan
# rustic onyx Traceback?

‎||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||https://khadz.fuckedyourmom.today/​‌​​​​​‌​‌‌​‌‌​​​‌​‌​‌​​​‌‌​​​‌​​‌​​‌​‌‌​‌‌‌‌​​​​‌‌​‌‌​‌​‌​​‌​​​

valid niche
#

And I still have a lot of headroom

valid niche
rustic onyx
#

I think you need to import random

rustic onyx
#

yeah

slate swan
keen comet
#

He forgor 💀

rustic onyx
valid niche
#

I have this

rustic onyx
#

Yup

#

Do you gave a referral or something?

valid niche
#

Nah

rustic onyx
#

F

keen comet
rustic onyx
#

The setup is in spanish/english or only dutch?

valid niche
#

If someone asks I say the host gif I’m not using referrals or so

valid niche
rustic onyx
#

Code: sebkuip

valid niche
#

But they are native to Germany

valid niche
#

So they also have everything in German not Dutch

#

Dutch is my language, from the Netherlands

#

Not from Germany

rustic onyx
#

But with knowing one you can know the other one pretty easy right?

valid niche
#

Anyways I’d say best is just to look around

rustic onyx
#

I've dutch friends and they all speak German

rustic onyx
#

Then its just a coincidence

valid niche
#

This is more recommended hosts for bots and whatnot

#

So take a look

rustic onyx
#

Alright

#

Thanks chief

valid niche
#

No worries

rustic onyx
#

Have a good one

valid niche
#

Certified guild?

#

Uh wat?

visual island
#

!custom-check

unkempt canyonBOT
#

Custom Command Checks in discord.py

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

from discord.ext.commands import check, Context

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

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

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

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

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

visual island
#

same goes with guilds

valid niche
#

Either a check or an on_message overwrite

visual island
#

!d discord.ext.commands.Bot.check also works

unkempt canyonBOT
#

@check```
A decorator that adds a global check to the bot.

A global check is similar to a [`check()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check") that is applied on a per command basis except it is run before any command checks have been verified and applies to every command the bot has.

Note

This function can either be a regular function or a coroutine.

Similar to a command [`check()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check"), this takes a single parameter of type [`Context`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Context "discord.ext.commands.Context") and can only raise exceptions inherited from [`CommandError`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CommandError "discord.ext.commands.CommandError").

Example...
hasty iron
#

check ctx.guild.id and compare it to your server id

#

if its comes out as True, return from the command

valid niche
dim cedar
#

anyone there?

#

i need help

keen comet
dim cedar
#

i made something

cloud dawn
dim cedar
#

but it doesnt create a channel

maiden fable
#

U need to use on_raw_reaction_add to check if someone reacted and then check if the emoji and the message is the same as the one u want

dim cedar
#

lemme show u my code

#
def check(reaction, user):
    return str(reaction) == ':envelope_with_arrow:' and ctx.author == user


@bot.command(pass_context=True)
async def ticket(ctx):
    guild = ctx.guild
    embed = discord.Embed(
        title = 'Ticket system',
        description = 'React :envelope_with_arrow: to make a ticket.',
        color = 0
    )

    embed.set_footer(text="ticket system")

    msg = await ctx.send(embed=embed)
    await msg.add_reaction(":envelope_with_arrow:")
    reaction = await ctx.fetch_message(msg.id)


    await bot.wait_for("reaction_add")



    await bot.wait_for("reaction_add")

    if reaction == ':envelope_with_arrow:':
      await bot.wait_for("reaction_add", check=check)
      await ctx.guild.create_text_channel(name=f'ticket - {reaction.author.name}')```
maiden fable
#

Ah

lament mesa
#

why are you waiting 2 times?

maiden fable
#

U need to save them in a var also

dim cedar
maiden fable
#

reaction, author = await bot.wait_for....

keen comet
dim cedar
#

made some changes

dim cedar
valid niche
dim cedar
cinder horizon
#
await msg.add_reaction("📩")
```isnt this ryt?
rustic onyx
#

is there any way in which I can get a complete list of the modules my bot uses so that I add those in the requirements.txt

rustic onyx
rustic onyx
hasty iron
rustic onyx
#

How exactly?

#

Just by the imports?

#

😩 lots of work 😛

dim cedar
#

can anyone say what is the prob?

rustic onyx
dim cedar
hasty iron
rustic onyx
#

!d try

unkempt canyonBOT
#
try

8.4. The try statement

The try statement specifies exception handlers and/or cleanup code for a group of statements...

dim cedar
#

it is not creating a channel

rustic onyx
#

use try & except

#

in except use print e with e being the exception

hasty iron
#

dont print it

rustic onyx
#

that should show the traceback

hasty iron
#

raise it

#

printing it wont show the traceback

rustic onyx
#

^^

#

mb

manic wing
#

catches error
raises error

dim cedar
#

well

#

can any of u guys

#

give me a fully working ticket system code

hasty iron
#

no

#

we wont

#

we dont spoonfeed

manic wing
#

you can print it with traceback like this;
print("".join(traceback.format_exception(error, error, error.__traceback__))))
where error is an exception

hasty iron
#

the first argument should be type(error) iirc

manic wing
#

no

#

you recall wrong

hasty iron
#

nope

#

!d traceback.format_exception

unkempt canyonBOT
#

traceback.format_exception(exc, /, [value, tb, ]limit=None, chain=True)```
Format a stack trace and the exception information. The arguments have the same meaning as the corresponding arguments to [`print_exception()`](https://docs.python.org/3.10/library/traceback.html#traceback.print_exception "traceback.print_exception"). The return value is a list of strings, each ending in a newline and some containing internal newlines. When these lines are concatenated and printed, exactly the same text is printed as does [`print_exception()`](https://docs.python.org/3.10/library/traceback.html#traceback.print_exception "traceback.print_exception").

Changed in version 3.5: The *etype* argument is ignored and inferred from the type of *value*.

Changed in version 3.10: This function’s behavior and signature were modified to match [`print_exception()`](https://docs.python.org/3.10/library/traceback.html#traceback.print_exception "traceback.print_exception").
hasty iron
#

it takes etype as first argument

#

which is Type[BaseException]

#

so type(error)

manic wing
#

!e import traceback
try:
print(x)
except Exception as error:
print("".join(traceback.format_exception(error, error, error.traceback)))

unkempt canyonBOT
#

@manic wing :white_check_mark: Your eval job has completed with return code 0.

001 | Traceback (most recent call last):
002 |   File "<string>", line 3, in <module>
003 | NameError: name 'x' is not defined
manic wing
#

@hasty iron

#

it doesnt look good in this eval

dim cedar
cinder horizon
manic wing
slate swan
#

man_facepalming

manic wing
#

!e import os
os.system('pip')

unkempt canyonBOT
#

@manic wing :warning: Your eval job has completed with return code 0.

[No output]
rustic onyx
#

I think its not

heavy gull
#

How do I make a user react to a reaction, the bot does a defined action?

dim cedar
#

i got a traceback

rustic onyx
manic wing
dim cedar
manic wing
#

!d discord.TextChannel.fetch_message

unkempt canyonBOT
#

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

Retrieves a single [`Message`](https://discordpy.readthedocs.io/en/master/api.html#discord.Message "discord.Message") from the destination.
rustic onyx
#

message = await fetch_message(id, /)

#

you need to store the fetched message and await it

hasty iron
dim cedar
#
msg = await ctx.send(embed=embed)
    await msg.add_reaction(":envelope_with_arrow:")
    reaction = await msg.fetch_message(msg.id)```
#

what is the prob in this?

manic wing
# heavy gull yes
message.add_reaction(emoji)
reaction, user = bot.wait_for("reaction_add", check=lambda r, u: u == ctx.author)
#do shit```
heavy gull
#

thanks

manic wing
slate swan
#

Can anyone tell me why my "help" command doesn't work?

dim cedar
#

to fix it

hasty iron
slate swan
manic wing
slate swan
#
@client.command()
async def help(ctx):
    await ctx.send("`prefix is ?")
dim cedar
hasty iron
dim cedar
manic wing
hasty iron
manic wing
#

you need to do bot.remove_command("help") or smthing

dim cedar
slate swan
hasty iron
#

bruh

manic wing
hasty iron
#

who "us", you mean you?

manic wing
dim cedar
hasty iron
#

nothing just ignore him

slate swan
#

Uh it didn't worked

#

I guess

manic wing
#

do you have an error you can send

hasty iron
#

you still havent sent the error

slate swan
manic wing
#

can you just send it here ..

slate swan
#

kk

pallid meadow
left dove
#

client = commands.Bot(command_prefix='-', help_command=None)

left dove
slate swan
#

Alright

hasty iron
#

nice spoonfeed

left dove
keen kraken
slate swan
left dove
#

but difference is i just gave the code

left dove
slate swan
#

Thanks blanket and you too

left dove
hasty iron
#

can you stop pinging

slate swan
#

lol

left dove
#

hmm. alright

manic wing
left dove
#

@keen kraken why did u gave frnd request to me??????????????????

left dove
dim cedar
#

making a ticket cmd

left dove
#

hmmm what ticket?

dim cedar
#

hmm

manic wing
#

oops

dim cedar
#

?

slate swan
dim cedar
left dove
#

just say wdym by ticket

manic wing
dim cedar
#

u heard that

left dove
#

we cannot code for u

dim cedar
#

but after a while u deleted your message

left dove
#

but we can help if u got stuck

dim cedar
left dove
dim cedar
#

just it ends up with error

left dove
#

send the error

dim cedar
#

thats why iam here

left dove
#

ok tell about the error

#

MAN AM SEEING CHANNELS MOVING UP AND DOWN

#

Some Mod is changing again and again

dim cedar
#

now the error is gone

left dove
#

ok

dim cedar
#

but channel is not getting created

dim cedar
left dove
dim cedar
#
def check(reaction, user):
    return str(reaction) == ':envelope_with_arrow:' and ctx.author == user

@bot.command(pass_context=True)
async def ticket(ctx):
    guild = ctx.guild
    embed = discord.Embed(
        title = 'Ticket system',
        description = 'React :envelope_with_arrow: to make a ticket.',
        color = 0
    )

    embed.set_footer(text="ticket system")

    msg = await ctx.send(embed=embed)
    await msg.add_reaction(":envelope_with_arrow:")
    reaction = msg.id
    if reaction == ':envelope_with_arrow:':
        await guild.create_text_channel(name=f'ticket - {reaction.author.name}')```
dim cedar
#

can u see?

left dove
dim cedar
left dove
#

tell the error name? or ss?

dim cedar
left dove
#

hmm

left dove
#

see that
reaction = msg.id

dim cedar
left dove
#

then how will it check that if statement

#

it will check the id

#

it will not check that emoji name

dim cedar
#

it was msg.fetch_message(msg.id)

left dove
#

check this code

#

if u need to check if the user reacted to the emoji then this is the code u want to add

slate swan
#

send error

dim cedar
slate swan
#

its not message.fetch_message

#

its ctx.channel.fetch_message

left dove
slate swan
#

also why do you need to fetch the message you alr got the message

manic wing
ornate coyote
#

so i wanted to convert a scratch project to python... can anyone help me?

ornate coyote
#

so '

slate swan
ornate coyote
#

how to convert it :3

#

Dm me

dim cedar
manic wing
#

you need an await

#

await bot.wait_for

slate swan
#

^^^

dim cedar
slate swan
#

is the check inside the command?

dim cedar
placid skiff
#

Why is rising me this error? ç_ç

jovial ivy
#

Hello again I have tried and tried and failed to do this, is anyone able to send the corrected code and explain to me what is going on?
code: https://pastebin.com/n5ndNMy2
Issue: I can't move the channel id from config to which messages should be sent, the problem is that messages are not sent to this channel
error in consolle: https://pastebin.com/HMV5zfi8

cloud dawn
crystal cliff
slate swan
cloud dawn
placid skiff
#

is the get_prefix method

#

!d discord.ext.commands.Bot.get_prefix

unkempt canyonBOT
#

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

Retrieves the prefix the bot is listening to with the message as a context.
crystal cliff
cloud dawn
placid skiff
#

bruh the message passed is a Message object D_D

placid skiff
cloud dawn
placid skiff
#

it's the message that i pass on get_prefix

dim cedar
cloud dawn
cloud dawn
#

you got an extra i, guiild

placid skiff
#

i m not understanding D_D

#

now it stops loading cog lol

cloud dawn
#

send me your code line 56

gleaming torrent
#

How do I set an limit for emojis?
To prevent emoji spam

placid skiff
#
    async def get_prefix(self, message: Message):
        pref = db.field("SELECT Prefix FROM guilds WHERE GuildID = ?", message.guild.id)
        return when_mentioned_or(pref)(self, message)
slate swan
#
@client.event
async def on_message(response):
    if response.content.lower()=="blank":
        responses=[f"**{response.author.name}, you say? @shrewd birch is a python-based discord bot developer (Beginner). Still he makes good stuff**", 'People say "He is still online"', "Blank is the hope of the future!", "I like Blank :3", "Hehe, What you wanna ask him??", "Blank is the secret of my energy!", "Blank.....", "Blank! Someone is calling you :D", "Blank is mine! Don't you dare steal him 😡"]
        if not response.author.id == owner_id:
            reply= random.choice(responses)
            webhook = await response.channel.webhooks()
            webhook = utils.get(webhook, name = "Embed Bot")
            if webhook is None:
                webhook = await response.channel.create_webhook(name = "Embed Bot")
            embed = discord.Embed(description=reply, colour= discord.Colour.random())
            await webhook.send(username="OwO", avatar_url="https://media.discordapp.net/attachments/861042562553872435/893878367726760006/cdn_discordapp_com-4844cebae2d84d63254ce5e383709a46__1_-removebg-preview.png", embed=embed)               

This won't run when I use the bot in replit

placid skiff
#

Now i have this D_D

cloud dawn
#

print it first

gleaming torrent
#

How do I prevent emoji spam?

slate swan
placid skiff
cloud dawn
cloud dawn
slate swan
gleaming torrent
#

So uh, how do I set a limit for emojis in a certain message

cloud dawn
#

That is called a database

placid skiff
cloud dawn
#

Pretty sure im not, you want to do an action later also if the bot restarts.

#

Your sleeps will be broken once it restarts so you need a database to let it keep working.

#

But you'd need another method that sleep.

cloud dawn
#

task, datetime objects, iterations etc

cloud dawn
dim cedar
# cloud dawn With?
@bot.command(pass_context=True)
async def ticket(ctx):
    guild = ctx.guild
    embed = discord.Embed(
        title = 'Ticket system',
        description = 'React :envelope_with_arrow: to make a ticket.',
        color = 0
    )

    embed.set_footer(text="ticket system")

    msg = await ctx.send(embed=embed)
    await msg.add_reaction(":envelope_with_arrow:")
    reaction =await ctx.channel.fetch_message(msg.id)

    def check(reaction, user):
      return str(reaction) == ':envelope_with_arrow:'and ctx.author == user  

    reaction, user =await bot.wait_for("reaction_add", check=check)
    if reaction == ':envelope_with_arrow:':
        await guild.create_text_channel(name=f'ticket - {reaction.author.name}')```
#

in this code the ticket is not creating channel

placid skiff
stiff nexus
#

help??```py
class Dropdown(discord.ui.Select):
def init(self):

    options = [
        discord.SelectOption(label='Red', description='Your favourite colour is red', emoji='🟥'),
        discord.SelectOption(label='Green', description='Your favourite colour is green', emoji='🟩'),
        discord.SelectOption(label='Blue', description='Your favourite colour is blue', emoji='🟦')
    ]

    super().__init__(placeholder='Choose your favourite colour...', min_values=1, max_values=1, options=options)

async def callback(self, interaction: discord.Interaction):

    await interaction.response.send_message(f'Your favourite colour is {self.values[0]}', ephemeral=True)

class DropdownView(discord.ui.View):
def init(self, ctx):
super().init(timeout=5)
self.ctx = ctx

    self.add_item(Dropdown())

async def on_timeout(self) -> None:
    self.children[0].disabled = True
    self.children[0].placeholde = 'Closed'
    await self.message.edit(view=self)

```it not changing the placeholder to Closed

quiet coral
#

hello how can I mention a user with a command in discord.py??

gritty jay
#

how can i make a bot that replys when i say something specific (for my server and a discord bot)

dawn zinc
#

hey guys. So I have a list of cuss words and if anyone uses any of those cuss words, how do I delete that message
and warn them. And if they do it again, kick them?

#

basically how the Python bot does it?

quiet coral
left dove
#

use ctx.author.mention

quiet coral
inland venture
#

hey anyone know how to set status for discord bot

#

i have pycharm

slate swan
#

!d discord.ext.commands.Bot

unkempt canyonBOT
#

class discord.ext.commands.Bot(command_prefix, help_command=<default-help-command>, description=None, **options)```
Represents a discord bot.

This class is a subclass of [`discord.Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") and as a result anything that you can do with a [`discord.Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") you can do with this bot.

This class also subclasses [`GroupMixin`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.GroupMixin "discord.ext.commands.GroupMixin") to provide the functionality to manage commands.
slate swan
#

it has an activity attribute

#

custom status:
no
either Playing, Streaming or Watching:
yes

dawn zinc
#

Hey guys! I am trying to create an admin bot. I wanted it to respond if i typed its name for testing, it is replying to every text from everyone. Please help me out here.

#
import discord
import datetime
import csv

client = discord.Client()

with open ('slangs.csv', 'r') as f:
    reader = csv.reader(f)
    data = list(reader)

@client.event
async def on_ready():
    print("Bot is online")

async def on_disconnect():
    print("Bot if offline")


@client.event
async def on_message(message):
    if message.author == client.user:
        return
    if message.author.id == 644126548818919434:
        if str(message.content).lower()=="Professor?":
            await message.channel.send("Professor is watching...")
    if str(message.content)=="Hi Professor":
        await message.add_reaction("\U0001F44B")
    if str(message.content) in data:
        await message.channel.send(f"You are voilating Server Rules. You will be kicked the next time. You have been warned.")
        await message.delete()
        
client.run('TOKEN')
dim cedar
#

hello

#

need help

#

i am doing my project in repl
so when i import google trans it auto installs the version 2.4.0
but i need 3.1.0a0
now when i do pip install googletrans == 3.1.0a0
it works well
but after a while when it refreshes it self the import causes a auto installation of version 2.4.0
so import googletrans gets unrecognized
and the whole code stops working

final iron
dim cedar
final iron
dim cedar
#

kidding

#

i'll go there

final iron
#

Hilarious

crystal wind
#

So I have a little issue with my join command with my bot. What I did here is making my bot play an mp3 audio file that I've stored in my disk locally, using FFMPEG. Although this works, every time I summon her, this message appears in the console, saying I haven't really defined the properties of the FFMPEG or something like that.

What I wish to do is to make this message gone to avoid my console to be spammed. What should I do?

outer violet
#

Is it possible to add a command to an on_message modmail system?

crystal wind
outer violet
#

So if a user does *report, all the messages after that, would get sent to the staff channel

crystal wind
#

Yeah you can do that by using an if condition. I'm not really advanced in such a thing, but everything is mostly possible.

outer violet
#

How would I save member id in a list and the bot doesn't detect other messages from member until the member id gets removed from list in my code? https://hastebin.com/hasehutane.properties it would look something like this with the reactions

slate swan
#

How to I send a message when a particular user (I have its ID) is mentioned

outer violet
#

I’m trying to make this message only send once but idk how to

waxen granite
#

can we hyperlink value in .add_field?

slate swan
slate swan
tropic briar
#

How do we detect spams like if I say
A message again and again then it will mute me

waxen granite
waxen granite
slate swan
slate swan
#

Don't know

tropic briar
#

Oh 😕

waxen granite
unkempt canyonBOT
waxen granite
#

its giving some expected error

slate swan
waxen granite
lament mesa
willow vine
#

i want to make an hourly reminder that keeps asking the user weather they did a particular task. i want to pass the task name as a parameter...how do i achieve this.. is there a way i can pass an argument in a task function

slate swan
slate swan
waxen granite
#

replacing " with ' worked

lament mesa
#

yeah

waxen granite
slate swan
#

Oh then nvm

lament mesa
stiff nexus
#

any examples on dropbox??? i dont want the danny thing i have seen it

slate swan
#

@stiff nexus You didn't event set scope in your bot's link

slate swan
stiff nexus
#

ya but i dont get it what u said

slate swan
stiff nexus
#

oh

final iron
#

Just wondering how are you catching and sending the error?

slate swan
#

hello guys! so i have this code that work perfectly fine. But i want it to make it, when the question end, it send what the user replied in the logschannel but dont know how. can you help?

#
@client.command()
async def dmtest(ctx):
      logschannel = ctx.guild.get_channel(891754397082734663)
      wres = discord.Embed(title="Πόσες ώρες έχετε στο FiveM?", description="", color=orange)
      steam = discord.Embed(title="Ποιό είναι το Steam Name σας?", description="", color=orange)
      disc = discord.Embed(title="Πόιο είναι το Discord Name σας?(μαζί με το #)", description="", color=orange)
      onoma = discord.Embed(title="Όνομα", description="", color=orange)
      await ctx.send(embed=onoma)
      def check(m):
          return m.channel == ctx.channel

      msg = await client.wait_for("message", check=check)
      await ctx.send(embed=wres)
      def check(m):
          return m.channel == ctx.channel

      msg = await client.wait_for("message", check=check)
      await ctx.send(embed=steam)
      def check(m):
          return m.channel == ctx.channel

      msg = await client.wait_for("message", check=check)
      await ctx.send(embed=disc)
stiff nexus
#

@slate swan now?

potent jetty
stiff nexus
#

u have any linkshortner?

crystal wind
slate swan
stiff nexus
willow vine
#

how to skip first iteration of task loop

slate swan
stiff nexus
#

np

boreal ravine
#

use user

slate swan
#

best python discord bot library (Not discord.py since its discontinued)

hasty iron
slate swan
#

its discontinued idiot

#

i want a fork

hasty iron
#

its still usable

#

all forks are shit

slate swan
#

what about pycord?

#

oh wait thats shit too

#

shit documentation

jade jolt
#

yup

slate swan
#

nextcord then?

hasty iron
#

whats wrong with using dpy

jade jolt
#

nothing imo

#

lol

slate swan
jade jolt
#

unlikely but go off

slate swan
#

pycord stole discordpy's docs LOL

#

and modified nothing on readthedocs

jade jolt
#

lmao

#

really??

slate swan
#

ye

#

this is the intro on pycord

jade jolt
#

kek

slate swan
#

and this is the dpy docs

#

its literally the same

jade jolt
#

lmaoooo

slate swan
#

yea

hasty iron
#

you’ll have to wait a good period of time before a good fork shows up

pliant gulch
#

Why would the docs for the intro change?

#

Its literally a fork

#

The only thing that would need changing in docs is any changes to methods or new changes

valid niche
#

pycord is the only somewhat decent fork that i know off

#

i'm currently helping development of disthon which is a long ways from a good stable release, but we're getting somewhere

#

it's not a fork but a complete rewrite from scratch

#

@slate swan

slate swan
valid niche
#

never heard of edpy

fallow mauve
#

for an embed, can i not put color=(member.avatar_color) to make the color of the embed whatever the users avatar color is?

slate swan
#

Member.color

stoic galleon
#

ctx.author.color

valid niche
slate swan
#

!d discord.Member.color

unkempt canyonBOT
#

property color: discord.colour.Colour```
A property that returns a color denoting the rendered color for the member. If the default color is the one rendered then an instance of [`Colour.default()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Colour.default "discord.Colour.default") is returned.

There is an alias for this named [`colour`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member.colour "discord.Member.colour").
slate swan
#

What is avatar collr

#

Color*

fallow mauve
slate swan
fallow mauve
valid niche
slate swan
#

Oh, banner

fallow mauve
slate swan
#

I'm not sure if that's possible

fallow mauve
#

it i

#

*is

valid niche
slate swan
#

Yeah

slate swan
valid niche
#

so it's an image and can be almost whatever

fallow mauve
valid niche
fallow mauve
valid niche
#

because it's only a solid color when you set it as one or don't have nitro

fallow mauve
#

ok

#

whatever

slate swan
#

No member color is top most role color

fallow mauve
#

oh

valid niche
#

so it might just be that your role color is the same as the banner

fallow mauve
#

oof

#

mhm

slate swan
#

Indeed

pliant gulch
#

The only way to get the users colour corresponding to their profile is via the master branch

#

It should be under

#

User.accent_colour

brazen seal
#

How i can fix this error?

pliant gulch
#

Context is under extensions since it's apart of commands

#

Would be discord.ext.commands.Context

#

Or if you have commands imported, commands.Context

valid niche
#

!d discord.ext.commands.Context

unkempt canyonBOT
#
class discord.ext.commands.Context(*, message, bot, view, args=..., kwargs=..., prefix=None, command=None, invoked_with=None, invoked_parents=..., invoked_subcommand=None, ...)```
Represents the context in which a command is being invoked under.

This class contains a lot of meta data to help you understand more about the invocation context. This class is not created manually and is instead passed around to commands as the first parameter.

This class implements the [`Messageable`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable "discord.abc.Messageable") ABC.
valid niche
#

that's the full path

valid niche
#

lets be freaky

pliant gulch
#

Not freaky just bad practice

valid niche
#

it's disgusting

brazen seal
valid niche
#

what in the world are those freaking imports

#

so many unused imports

#

so many random imports that are NEVER needed

#

so many redundant imports

valid niche
brazen seal
#

okay

#

i remove import which i don't use

brazen seal
reef shell
#

It's discord.Intents

#

!d discord.Intents

unkempt canyonBOT
#

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

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

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

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

New in version 1.5...
brazen seal
reef shell
#

You are importing discord.ext.commands as discord

hasty iron
#

you still have the import discord.ext.commands as discord

reef shell
#

That's why

#

Idk why someone would do that
Like importing somthing else as discord

brazen seal
pliant gulch
#

That's not causing the error

#

And it's not passing a param to ctx

#

That's a type hint lmao

scarlet snow
#

oh

pliant gulch
#

The error is because they didn't pass a listing tuple to aliases

scarlet snow
#

true true

#

mbad

pliant gulch
#

Pass a list or tuple to aliases

slate swan
brazen seal
#

i add [ this and ] this

#

and it work

slate swan
#

yeah

#
client = commands.Bot(command_prefix=[f"{get_prefix}", f"{prefix}"], help_command=None)
#

Can someone help me? ;-;

slate swan
#

I want a permament prefix + custom prefix

#

no need of 2 f string

slate swan
#

Ah wait mb

#

prefix works

#

get_prefix dont

#

only get_prefix works well

#

:(

#

Define one prefix in the statement and later use the custom prefix for servers

#

hello can someone send an invitation link from a personal made music bot(if u guys have one)i need it in my server

reef shell
slate swan
slate swan
# slate swan I want both T^T

In on message event inside the command processes use a function which adds the prefix based on server + the permanent prefix

reef shell
slate swan
#

It other words

#

nvm

slate swan
#

Knew it

#

you should definitely google instead

#

...

quiet coral
#
@client.event 
async def on_member_join(member):
    await member.send("Hello, you're not welcome here get out of my server!!! 😘")

Is something wrong with my event cause It's not doing anything when someone joins the server

reef shell
#

You had members intent turned on?

quiet coral
#

no

#

how do I do that?

slate swan
#

wait

reef shell
#

Dev. Portal

slate swan
#

Lol

reef shell
#

And also in code

valid niche
slate swan
#

it's a tag on the dpy server

valid niche
#

right lmao

reef shell
slate swan
#

how2intents

reef shell
#

Oh

valid niche
#

found ya

reef shell
#

try the 420 iq tag and also slash cmd

slate swan
#

hm

quiet coral
quiet coral
slate swan
#

Sherlock

#

I..... hate you

#

for making this tag

#

you're a bad person

reef shell
hasty iron
#

your average tag maker

pliant gulch
#

Inb4 "."

reef shell
slate swan
#

guys how do people make those silent messages

#

those "only u can see this" messages

#

i see that bots can do them now

#

an example of this is when u do [/nick name] if u dont know what im talking about

reef shell
#

They are called ephemeral messages

slate swan
#

what's the paramter for it?

#

for a textchannel class

#

the uh, send attribute

reef shell
#

idk if you can send a message directly like this...
But yeah you can send ephemeral messages in reply to interaction response.

slate swan
#

interaction response?

reef shell
#

Yes

slate swan
#

the ui kit thing?

pliant gulch
#

Those are from components and slash commands

#

As well as webhooks iirc

slate swan
#

so i cant do it directly or?

#

!discord.Textchannel.send

pliant gulch
#

Not through a normal message

slate swan
#

oh

#

that sucks

reef shell
#

lol

slate swan
#

So its not like i can do ctx.send(thekwargname="")?

valid niche
#

as the others have said, those are ephemeral messages, and are only allowed when using interactions (buttons) and slash commands (the discord commands system). Outside of that the only way is to send a DM to a user

slate swan
#

oh well

#

Then there isnt much I can do

slate swan
#

Ig i'll have to make it send stuff in dms

rustic venture
#

Hey, is there any opportunity to check if someone has a certain role?

reef shell
#

yes

valid niche
pliant gulch
slate swan
#

!d discord.Member.roles

unkempt canyonBOT
#

property roles: List[Role]```
A [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role") that the member belongs to. Note that the first element of this list is always the default [‘@everyone](mailto:'%40everyone)’ role.

These roles are sorted by their position in the role hierarchy.
slate swan
#

@rustic venture Here is where u can find it on docs for more information.

#

using the if statement like sebkuip just stated above u can search for a piticular role in the list of role objects

#

omg i cant spell today

#

particular*

rustic venture
#

So when i want to check if a person has a role like Muted
value=f'{idk what i should write here .. xd}'.....

rustic venture
#

and then the role id?

slate swan
#

To find a role object using the role id u can use ctx.guild.get_role(roleid)
(assuming that ur using commands)

rustic venture
#

i have the role id xd

{890224661470793818 in member.roles}

slate swan
#

what's with the {}?

#

Your doing this in a f string?

rustic venture
valid niche
#

member.roles is all roles

#

it's a list of role objects

rustic venture
#

yeah

valid niche
#

it will NOT work with an ID

slate swan
#

To mention the author or the role?

#

objective*

rustic venture
#

i need
Muted: YES OR NO ;D

slate swan
#

oh

rustic venture
#

xd sorry

slate swan
#

why not use a function?

rustic venture
#

idk bro

slate swan
#

that can return u a value

#

instead of doing that

rustic venture
#

and what should i code ^^for this xd

valid niche
#

if you just want true/false do the role in member.roles

#

no need to overcomplicate it

slate swan
#

like

def rolecheck(member,role):
  if role in member.roles:
    return "YES"
  else
    return "NO"```
#

u can put that before your embed

#

oh wait i forgot to name the fucntion

rustic venture
slate swan
#

like that

rustic venture
#

okey ;D

valid niche
rustic venture
#

bro whats the objekt

slate swan
#

then in ur value just do {def(membervariable,muteroleobject)}

valid niche
#

an instance of discord.Role

slate swan
#

U can use guild.get_role(ID) to get the role object

#

!discord.Guild.get_role

rustic venture
#

oh okey ;d

valid niche
#

!d discord.Guild.get_role

unkempt canyonBOT
slate swan
#

Ye that^

rustic venture
#

I love you ;D

slate swan
#

no homo

rustic venture
#

👀 ✅

#

is there any way to check if a member is banned?
so i can do
Banned: None ; Yes (if possible Reason)

slate swan
pliant gulch
#

A user not being in a server does not always mean they are banned

#

You will need to check the guilds banned list

#

!d discord.Guild.bans

unkempt canyonBOT
#

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

Retrieves all the users that are banned from the guild as a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`BanEntry`](https://discordpy.readthedocs.io/en/master/api.html#discord.BanEntry "discord.BanEntry").

You must have the [`ban_members`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.ban_members "discord.Permissions.ban_members") permission to get this information.
slate swan
pliant gulch
#

Your idea could be a lot more cleaner as well

#
if discord.utils.get(guild.members, member_obj): ...
#

Or guild.get_member with passing the Id

slate swan
#

coolio

#

remind me to not help ppl again

#

cuz i suck B)

hasty iron
#

get takes an iterable and kwargs

rustic venture
hasty iron
#

no other positional arg

pliant gulch
#

Just go for get_member then or pass id=id

#

Or use find

slate swan
#

utils, forgot about those

kindred epoch
waxen granite
#
        lv1 = self.bot.get_channel(893530410531815424)
        if message.channel == 786682458921238548:
            embed = discord.Embed(title = message.author, description = message.content, timestamp = datetime.datetime.utcnow())
            await lv1.send(embed = embed)```
`lv1` is a channel in `guild1`, `message.channel = id` is a channel in `guild2`. this should send msgs from lv1 to ksv , or did i do it wrong?
slate swan
hasty iron
kindred epoch
hasty iron
#

get_member just grabs a member from cache

kindred epoch
hasty iron
#

find_user isnt a thing either

kindred epoch
#

fetch_user

#

kek

hasty iron
#

thats an api call

slate swan
hasty iron
#

callback?

pliant gulch
#

what

slate swan
#

oh wait nah im thinking or smth else

#

i was thinking about traceback 🤣, that's a whole different topic

kindred epoch
waxen granite
#

trying to send msgs from a channel to another channel

#

the both channels are in different guilds

pliant gulch
reef shell
#

use the attr. .id
ez

waxen granite
#

that ty

slate swan
#

the variable is discord.GuildChannel