#discord-bots

1 messages · Page 640 of 1

spring flax
#

so i don't need walrus?

maiden fable
#

Okay so it's like, it will assign the value to the variable inline. So,

if role := disnake.utils.get(...):
    # role will be either None or the value returned by the utils.get
pliant gulch
#

You may also use the walrus operator if your on python 3.8+ and you don't feel like writing an if statement

maiden fable
#

I think this is what it should be

#

andy, me right or wrong?

pliant gulch
#

We're using find, not get here

#

Get looks for attributes

maiden fable
#

It was just an example tho

pliant gulch
#

Other than that, yes the walrus is correct

maiden fable
#

Don't bulli, I am writing code on mobile rn ;-;

outer violet
#

How do I get the bot to do this? Like have the chat bubble

tawdry perch
#

I have semi good embeds for mod log/general log. What do you think

maiden fable
unkempt canyonBOT
#

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

Triggers a *typing* indicator to the destination.

*Typing* indicator will go away after 10 seconds, or after a message is sent.
outer violet
#

Oh okay

tawdry perch
#

now comes the boring part... the actual logging

maiden fable
#

🤣

#

Facts tho

tawdry perch
#

I would have to log pretty much everything..

maiden fable
#

O

sullen shoal
#

create a class for logging, it helps

maiden fable
tawdry perch
sullen shoal
tawdry perch
#

I have embed creator that I yeeted from @unkempt canyon

tawdry perch
#

did I make it correctly, except the missing :?

maiden fable
#

O thanks

pliant gulch
sullen shoal
#

actually the file can be copy pasted too

tawdry perch
spring flax
#

@maiden fable is this good?

@bot.event
async def on_member_update(before, after):
    channel = disnake.utils.get(before.guild.channels, id=829046242146910215)
    role = disnake.utils.get(after.guild.roles, id=803191738683621416)
    
    role_id_list = ["something", "something", "something","something", "something", "something"]
    member = after
    if role in before.roles and role not in after.roles:
        if role := disnae.utils.find(lambda r: r.id in role_id_list, after.role):
            await role.remove(reason="User stopped boosting the server")
maiden fable
#

Also @tawdry perch make a webhook

tawdry perch
#

I hate that idea but I have to accept that it is actually only working way

#

mind to link me the docs again?

maiden fable
sullen shoal
maiden fable
#

Oh nvm it will

#

My bad. Yea, it looks perfect

pliant gulch
#

Kinds useless? imo it's quite helpful utility

#

Plus you can add a Queue and wait for 10 to send at a time

maiden fable
#

Ah u referring to myxi. Thought u were talking to me

tawdry perch
#

what is the docs for webhooks

sullen shoal
maiden fable
#

Uhhh I forgot

#

!d discord.Webhook

unkempt canyonBOT
#

class discord.Webhook```
Represents an asynchronous Discord webhook.

Webhooks are a form to send messages to channels in Discord without a bot user or authentication.

There are two main ways to use Webhooks. The first is through the ones received by the library such as [`Guild.webhooks()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild.webhooks "discord.Guild.webhooks") and [`TextChannel.webhooks()`](https://discordpy.readthedocs.io/en/master/api.html#discord.TextChannel.webhooks "discord.TextChannel.webhooks"). The ones received by the library will automatically be bound using the library’s internal HTTP session.

The second form involves creating a webhook object manually using the [`from_url()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Webhook.from_url "discord.Webhook.from_url") or [`partial()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Webhook.partial "discord.Webhook.partial") classmethods.

For example, creating a webhook from a URL and using [aiohttp](https://docs.aiohttp.org/en/stable/index.html "(in aiohttp v3.7)"):
tawdry perch
#

ok I'll find em manuallly

maiden fable
#

There

cedar stream
#

I just send direct request to webhook

sullen shoal
#

you can only send 10k requests in 10mins iirc

tawdry perch
#
from discord import Webhook
import aiohttp

async def foo():
    async with aiohttp.ClientSession() as session:
        webhook = Webhook.from_url('url-here', session=session)
        await webhook.send('Hello World', username='Foo')
``` the `url-here` means the webhook url, right?
sullen shoal
#

webhook url i think

tawdry perch
#

now let's see if I have permissions to create a webhooks

maiden fable
sullen shoal
spring flax
tawdry perch
#

uh.. what if I don't have permissions to create a webhook, the bot might have that permission

boreal ravine
#

!d discord.Webhook.from_url

unkempt canyonBOT
#

classmethod from_url(url, *, session, bot_token=None)```
Creates a partial [`Webhook`](https://discordpy.readthedocs.io/en/master/api.html#discord.Webhook "discord.Webhook") from a webhook URL.
boreal ravine
#

Nice

maiden fable
tawdry perch
#

but I don't have any permissions to create a webhook, how can I get the url if it does not exist?

#

wait.. The bot should be able to create a webhook, right?

#

found it ```py
channel.create_webhook(name="mywebhook")

sullen shoal
#

¯_(ツ)_/¯ if the bot has perms to do it

spring flax
#

wait...What's the role object here for the if disnake.utils.find... statement?

    if role in before.roles and role not in after.roles:
        if disnake.utils.find(lambda r: r.id in role_id_list, after.role):
tawdry perch
sullen shoal
#

check what it returns

sullen shoal
#

!d discord.TextChannel.create_webhook

unkempt canyonBOT
#

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

Creates a webhook for this channel.

Requires [`manage_webhooks`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_webhooks "discord.Permissions.manage_webhooks") permissions.

Changed in version 1.1: Added the `reason` keyword-only parameter.
spring flax
maiden fable
boreal ravine
#

:= 👌

spring flax
#

is that new feature? i haven't use python in like 3 months but never heard of it

maiden fable
#

But it's not heavily used in daily life (that's what I noticed ngl)

velvet tinsel
#

💀

pliant gulch
maiden fable
pliant gulch
#

People tend to hate it though

maiden fable
pliant gulch
#

Walrus operator and typehint syntax is basically the reason why all my repo's are 3.9+

sullen shoal
#

!e

if s := "h" in "hello":
    print(s)
if (s := "h") in "hello":
    print(s)```
unkempt canyonBOT
#

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

001 | True
002 | h
sullen shoal
#

keep in mind that tho

spring flax
#

soooooo this should work right

    role_id_list = ["something", "something", "something","something", "something", "something"]
    member = after
    if role in before.roles and role not in after.roles:
        if role := disnake.utils.find(lambda r: r.id in role_id_list, after.role):
            await member.remove_roles(role, reason="User stopped boosting the server")
tawdry perch
#

for a webhook is the avatar needed?

maiden fable
#

Yea

maiden fable
tawdry perch
#

good

#
    @commands.command()
    @restrict_to_user(534738044004335626)
    async def create_webhook(self, ctx, name: str):
        await ctx.channel.create_webhook(name=name, reason="I don't have permission to create webhook so bot made it")
``` perfect webhook
slate swan
#

!code

spring flax
maiden fable
spring flax
#

@slate swan you can do in #bot-commands

sullen shoal
maiden fable
sullen shoal
#

!e print("h" in "hello")

unkempt canyonBOT
#

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

True
tawdry perch
#

so.. can I get the url of webhook name?

maiden fable
sullen shoal
maiden fable
vocal plover
unkempt canyonBOT
#

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

Gets the list of webhooks from this channel.

Requires [`manage_webhooks`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_webhooks "discord.Permissions.manage_webhooks") permissions.
maiden fable
#

O Alec here

maiden fable
vocal plover
#

nah thats a weird one

#

strange that discord has no fetch_webhook endpoint

maiden fable
#

Alec still in Halloween mood

maiden fable
sullen shoal
tawdry perch
vocal plover
#

i actually put the pumpkin on after halloween was over because someone said that halloween must end

maiden fable
sullen shoal
maiden fable
#

And it prints True

tawdry perch
#
Nipa Bot#7999 did AuditLogAction.webhook_create to <Object id=916138944969318012>
``` is it the ID of webhook?
tawdry perch
#

hm

marsh sparrow
#

hi i wanna create a bot help me

sullen shoal
#

there are some other forks as well

raw sedge
#

yo uhh

#

im getting an error but idk what im doing wrong

sullen shoal
#

show error; show code

raw sedge
#

sure

sullen shoal
#

!ytdl

unkempt canyonBOT
#

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

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

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

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

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

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

no help with this

raw sedge
#

ah rip

tawdry perch
#

    @commands.command()
    async def fetch_webhooks(self, ctx):
        a = await ctx.channel.fetch.webhooks(self.web_id)
        await ctx.send(a)
```so what was the correct way to get it, and how do I convert it to url
#

does it require smth like self.bot.fetc_webhook(id)

manic wing
#

!d discord.TextChannel.webhooks || webhook = channel.webhooks[channel.webhooks(index(self.web_id))

unkempt canyonBOT
#

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

Gets the list of webhooks from this channel.

Requires [`manage_webhooks`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_webhooks "discord.Permissions.manage_webhooks") permissions.
manic wing
#

something like this

#

actually no

#

im a moronic goose

#

webhook = [k for k in channel.webhooks if k.id = self.web_id]

#

@tawdry perch

pliant gulch
#

discord.utils.get exists

manic wing
#

both work

boreal ravine
pliant gulch
boreal ravine
#

🤷‍♂️

tawdry perch
#

because I alrd got the webhook IDs from a channel

slate swan
#

!code

unkempt canyonBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

tawdry perch
#

I got the URL!!

manic wing
#

!d discord.Webhook || it returns a webhook, but you can do [0].url I presume. Or you can use webhook = discord.utils.get(channel.webhooks, id=id) if the others get touchy

unkempt canyonBOT
#

class discord.Webhook```
Represents an asynchronous Discord webhook.

Webhooks are a form to send messages to channels in Discord without a bot user or authentication.

There are two main ways to use Webhooks. The first is through the ones received by the library such as [`Guild.webhooks()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild.webhooks "discord.Guild.webhooks") and [`TextChannel.webhooks()`](https://discordpy.readthedocs.io/en/master/api.html#discord.TextChannel.webhooks "discord.TextChannel.webhooks"). The ones received by the library will automatically be bound using the library’s internal HTTP session.

The second form involves creating a webhook object manually using the [`from_url()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Webhook.from_url "discord.Webhook.from_url") or [`partial()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Webhook.partial "discord.Webhook.partial") classmethods.

For example, creating a webhook from a URL and using [aiohttp](https://docs.aiohttp.org/en/stable/index.html "(in aiohttp v3.7)"):
tawdry perch
#

I'll keep this in mind!

#

thx alot 😄

sullen shoal
coral flame
#

maybe they are forgetful lol

tawdry perch
#

!d discord.Webhook.from_url

unkempt canyonBOT
#

classmethod from_url(url, *, session, bot_token=None)```
Creates a partial [`Webhook`](https://discordpy.readthedocs.io/en/master/api.html#discord.Webhook "discord.Webhook") from a webhook URL.
tawdry perch
#

I tried to pass session but it was invalid for some reason.

coral flame
#

what did you pass?

tawdry perch
#

session = session

sullen shoal
#

what is your session

coral flame
#

and session is a ClientSession?

tawdry perch
#

    async def send_webhook(self, embed: discord.Embed):
        async with aiohttp.ClientSession() as session:
            webhook = Webhook.from_url(self.webhook, adapter=session)
            return await webhook.send(embed=embed)
#

it seems to be called adapter

velvet tinsel
#

Lots of errors cyberweapon

#

What are you trying to make?

tawdry perch
#

and I just managed to finish making it! (yes, fixed it smh)

velvet tinsel
#

Nice!

#

…my bot still brokken

#

💀😭

tawdry perch
velvet tinsel
#

Some weird piece of code is not functioning as it’s supposed to

tawdry perch
#

add a lot of debugging

velvet tinsel
#

Debugging wasn’t working tho 😭

tawdry perch
#

so it does not even get ran?

velvet tinsel
#

It worked on other piece of code and I tried printing it

#

Nothing happened so I had to email father

tawdry perch
#

share the code? Tho I most likely can't help you if I have not made anything similar to it but it's worth a try I guess

slate swan
sullen shoal
coral flame
#

lol

velvet tinsel
coral flame
#

send anyways, maybe we can find the problem

slate swan
velvet tinsel
#

Ok

#

But I don’t have my PC

#

but I do have a link

#

But I already updated it

#

So it’s kind of old

#

But I’ll send it anyways

tawdry perch
#

did the updated version work? if no, then it's worth to send the old one

velvet tinsel
#

It did work

tawdry perch
#

so it's now fixed and nothing broken anymore?

velvet tinsel
#

No

#

One part of the code broken

tawdry perch
#

well send anyways and I can find out what you were trying in first place

velvet tinsel
#

Errrrr ok

#

Here’s the latest version of a snippet

#

It doesn’t execute that

#

res is nothing

tawdry perch
#

do you happen to have a whole code of that thing?

velvet tinsel
#

An old version, yes

tawdry perch
#

well I can take a look at the new one later

velvet tinsel
tawdry perch
#

indeed a messy, bunch of statements

velvet tinsel
#

Of course

#

What did you expect

tawdry perch
slate swan
#
    if set(message_set) & set(self.blacklisted_stuff): return await message.channel("catched something")
TypeError: 'TextChannel' object is not callable```
#

confused

#
    @commands.Cog.listener()
    async def on_message_delete(self,message):
        if message.author.id == 218438244289740800:
            self.message = '**cants snipe boot**'
            self.author = message.author
        message_set = message.content.lower().split()
        if set(message_set) & set(self.blacklisted_stuff): return await message.channel("catched something")
        self.message = message.content
        self.author = message.author```
tawdry perch
#

you did message.channel() that can't be called Í guess

slate swan
#

ohh

#

its message.channel.send()

tawdry perch
#

yes

slate swan
#

thanks

tawdry perch
#

np

#

what do you think about this log webhook

sullen shoal
#

what are you going to log

tawdry perch
#

All sort of events

#

Infractions, triggers, changes etc

visual island
unkempt canyonBOT
#

discord/ext/commands/core.py lines 541 to 545

if isinstance(converter, Greedy):
    if param.kind in (param.POSITIONAL_OR_KEYWORD, param.POSITIONAL_ONLY):
        return await self._transform_greedy_pos(ctx, param, required, converter.converter)
    elif param.kind == param.VAR_POSITIONAL:
        return await self._transform_greedy_var_pos(ctx, param, converter.converter)```
sullen shoal
#

but i heard discord.py handles rate limits so maybe it wont be the problem

coral flame
#

yeah, afaik it handles ratelimits automatically

shadow wraith
#

apparently whenever i try making my cog and defy the cog class, there's always an issue where usually whenever i do def <cogname>(commands.Cog): it always says that commands.Cog syntax is wrong

shadow wraith
#

wait

#

im stupid af it's class not def 💀

slate swan
#

yeah lmao

slate swan
#

so i have 3 work commands
such as coder,gamer and artist
and i want to make a command which let the users take those work command such as
!work coder
and then they use this command and if they use !work the coder command will get trigered
and !work gamer wouldnt work for few hours
so is sql database required to store this data?

visual island
#

you can use cooldowns

tawdry perch
slate swan
#

or have you used dank memer?

placid skiff
#

Guys i'm trying to run a disnake bot, i get this error and don't understand why, someone can help?

[...]
disnake.errors.HTTPException: 401 Unauthorized (error code: 0): 401: Unauthorized

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\giacomo.dimatteo\PycharmProjects\botDisnake\launcher.py", line 7, in <module>
    bot.run(VERSION)
  File "C:\Users\giacomo.dimatteo\PycharmProjects\botDisnake\botLib\Bot\__init__.py", line 77, in run
    super().run(self.token)
[...]
RuntimeError: Event loop is closed
tawdry perch
#

Wrong token?

placid skiff
#

I'll check, but it is copied so I don't think

#

It is correct

boreal ravine
placid skiff
#

Yes

boreal ravine
# placid skiff Yes

Enable the application.commands scope in your bot using the developer portal and then re-invite your bot again

placid skiff
placid skiff
#

just testing if the bot comes online

boreal ravine
#

hm

placid skiff
#

i don't know how to do it xD

visual island
placid skiff
#

i saw

#

I'm keep checking but it is correct, I checked with the debug and the os.environ get the token, i try to pass it to the bot directly

#

Yes, without using environ but passing the token directly it works

#

but why?, I already used enviroment variable and always worked

slate swan
#

icy can you help me?

placid skiff
sullen shoal
#

what do you use to load env variables

#

python-dotenv?

placid skiff
#

os.environ

#

i added two unnecessary "", now it works

sullen shoal
#

!d os.getenv

unkempt canyonBOT
#

os.getenv(key, default=None)```
Return the value of the environment variable *key* if it exists, or *default* if it doesn’t. *key*, *default* and the result are str.

On Unix, keys and values are decoded with [`sys.getfilesystemencoding()`](https://docs.python.org/3/library/sys.html#sys.getfilesystemencoding "sys.getfilesystemencoding") and `'surrogateescape'` error handler. Use [`os.getenvb()`](https://docs.python.org/3/library/os.html#os.getenvb "os.getenvb") if you would like to use a different encoding.

[Availability](https://docs.python.org/3/library/intro.html#availability): most flavors of Unix, Windows.
prisma spoke
#

hey i have this code

    def __init__(self):
        super().__init__()
        self.value = None

    @nextcord.ui.button(label = "Aprrove", emoji=":heavy_check_mark:", style=nextcord.ButtonStyle.green)
    async def approve(self, button: nextcord.ui.Button, interaction: nextcord.Interaction):
        if interaction.user.guild_permissions.administrator:

            embed= nextcord.Embed(description=f"{suggestion}\nThe suggestion has been denied by {interaction.user.mention} message link = {message}") 
            channel = nextcord.utils.get(interaction.guild.text_channels,name="〢suggestion-approval" )
            await channel.send(embed=embed) 
            self.value=True
            self.stop()


    @nextcord.ui.button(label = "Deny", emoji=":heavy_multiplication_x:", style=nextcord.ButtonStyle.gray)
    async def deny(self, button: nextcord.ui.Button, interaction: nextcord.Interaction):
        if interaction.user.guild_permissions.administrator:

            embed= nextcord.Embed(description=f" {suggestion}\nThe suggestion has been denied by {interaction.user.mention} message link = {message}")
            channel = nextcord.utils.get(interaction.guild.text_channels,name="〢suggestion-approval" )
            await channel.send(embed=embed) 
            await interaction.response.send_message(embed=embed)

            self.value=False
            
            self.stop()

@client.command(aliases=["suggest"])
async def suggestion(ctx,*,suggestion:str):
    view=Suggest()
    embed=nextcord.Embed(title=f"Suggestion by {ctx.author.name}#{ctx.author.discriminator}", description=f"{suggestion}")
    channel = nextcord.utils.get(ctx.guild.text_channels,name="〢suggest-here" )
    await channel.send(embed=embed, view=view)
    await view.wait()```
 i want that on the reaction of the button... in the interaction response msg it shud show the users suggestion too
but this just prints out suggestion
and not the suggestion the user gave
velvet tinsel
#

I’ve got like 60 weaknesses in my code

slate swan
velvet tinsel
#

Yes

#

Lots in fact

slate swan
slate nymph
#

how to make a rtemp role command?

#

temp

velvet tinsel
#

I forgor 💀

#

What is the temp role

slate nymph
#

any

slate swan
velvet tinsel
#

Temporarily roll 💀

slate swan
slate swan
#

If you trying to do it in the same function use asyncio.sleep()

velvet tinsel
vague grove
#

how can i see if theres a role in a server and return a true or false

slate swan
#

Anyone know how to make bot reply prefix when pinged I tried in js but it ain’t working

tawdry perch
visual island
slate swan
#

Anyone know how to make bot reply prefix when pinged I tried in js but it ain’t working

visual island
unkempt canyonBOT
vague grove
#

or that

#

thats more efficient

slate swan
#

Ok

slate swan
vague grove
slate swan
#

@vague grove @visual island thx

vague grove
#

yeye

visual island
vague grove
visual island
#

no

#

use get_role() or utils.get()

vague grove
#

just get_role()?

#

or client.

visual island
#

guild.

vague grove
#

k

vague grove
# visual island guild.

I got the error Command raised an exception: AttributeError: 'NoneType' object has no attribute 'permissions'
my code is

@client.command()
async def role(ctx):
    role = ctx.guild.get_role("test!")
    if role.permissions.administrator:
        print("admin")
    else:
        print("No admin.")
boreal ravine
boreal ravine
vague grove
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...
vague grove
velvet tinsel
boreal ravine
velvet tinsel
#

How do you copy text using like a command like the bookmark command in sir Lancebot

#

💀

vague grove
unkempt canyonBOT
boreal ravine
velvet tinsel
vague grove
boreal ravine
#

👍

velvet tinsel
#

Thank you kayle ❤️

#

😳

slate swan
tawdry perch
velvet tinsel
tawdry perch
#

ok_handbutflipped .

velvet tinsel
tawdry perch
#

where can I find list of all events, such as on_member_join and well a list of events

velvet tinsel
#

Errr

tawdry perch
#

it only has few of them

timber crescent
#

can someone show me an example of bot.wait_for('add_reaction')

maiden fable
#

!d discord.ext.commands.Bot.wait_for

unkempt canyonBOT
#

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

Waits for a WebSocket event to be dispatched.

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

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

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

This function returns the **first event that meets the requirements**...
sullen shoal
#

click the title

tawdry perch
maiden fable
#

Lemme see

timber crescent
#

can you help me define a check?

#

for event add_reaction

tawdry perch
#

it's just a function

maiden fable
#

There's a problem

#

@tawdry perch u didn't subclass commands.Cog

tawdry perch
#

fk

timber crescent
#

i want it to check if the person adding the reaction is the same person who triggered the command(msg.author)

tawdry perch
#

otherwise it's good?

timber crescent
#

how do i refer to the person adding a reaction?

maiden fable
#

@tawdry perch don't send on reaction add

tawdry perch
#

I forgot to remove it

maiden fable
#

That.... just doesn't make any sense ngl

#

Hey BTW, I have another idea

#

(Sorry Diabolical I am stealing yours here)

#

Just send a message in another channel instead of logs whenever a person boosts a server

spring flax
#

on_guild_update is triggered when the number of server boosters change right?

tawdry perch
#

wym?

timber crescent
#

what does the lambda user at the beginning mean?

maiden fable
tawdry perch
#

ah ok

spring flax
#

thanks, wasn't included in the docs for that page

#

and you're sure right?

timber crescent
#

i've used bot.wait_for for 'message' before but how do i change it for add reaction?

maiden fable
#

Well I guess boost a guild yourself and see it

tawdry perch
#

sure, let me just buy a nitro for that

timber crescent
#

i need to know the reaction added and the person who added it

maiden fable
maiden fable
tawdry perch
#

now time to design fricking log messages ;-;

maiden fable
#

🤣

#

Just make a JSON for them

#

Don't hardcode them inside the code

tawdry perch
#

I have embed builder alr

maiden fable
#

Just use

#

!d discord.Embed.from_dict

unkempt canyonBOT
#

classmethod from_dict(data)```
Converts a [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.9)") to a [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") provided it is in the format that Discord expects it to be in.

You can find out about this format in the [official Discord documentation](https://discord.com/developers/docs/resources/channel#embed-object).
maiden fable
#

Use this

#

Would be better ngl

tawdry perch
#
        content = await self.modlog.send_log_message(
            self, colour=discord.Color.red(), title=f"{member} | {member.id} has joined", 
            text="", icon_url=member.avatar_url, 
            content="Sample content", footer="Logger webhook", ping_everyone=True
                #thumbnail="Sample thumbnail"
            )
        await ModLog.send_webhook(self, content)
``` this sends a embed, and a webhook for me (indent fked up)
maiden fable
#

O

tawdry perch
#

Kinda easy

#

Result would look smth like this

maiden fable
#

Mhm

slate swan
#
@bot.command()
async def gamer(ctx):
        await ctx.send('You have 2 Choices \n(A)A Baseball Bat With Iron Wires Coverd\n(B)An M16 With 90 Bullets\n what will you choose?')
        channel = ctx.message.channel
        player = ctx.author
        gg = random.randint(100, 150)
        wala = random.randint(50, 100)

        def nocheck(m):
          return m.content == "(B)" or 'b' or 'B' or '(b)' and m.channel == channel
        if msg = await bot.wait_for('message', check=nocheck)
        await ctx.send(f"You aint a real gamer and dont understand fun it but then to got **{wala}:nexus:**")

        def check(m):
         return  m.content == "A" or m.content == '(A)' or m.content == "a" or m.content == "(a)" and m.channel == channel

        else msg = await bot.wait_for('message', check=check)
        c.execute(f"UPDATE data SET balance = balance+{gg} WHERE ID = {player.id}")
        conn.commit()
        await ctx.send(f"You Are A Real Gamer **{gg}:nexus:** as Gift From Every Gamer")
        print(gg)

syntax error if msg =

#

help pls

vale wing
#

= is not a comparison operator if you meant to compare them

slate swan
#

Missing a =

vale wing
#

The comparison operator is ==

slate swan
#

Although that's not how it works

vale wing
#

But I pretend the if is not needed

#

Yeah the if is extra

slate swan
timber crescent
#

so im tryna make a selection out of 5 reactions and have bot know what i selected

#

im using bot.wait_for('reaction_add'.......

#

and this is my check

#

def check(reaction, user):
return user==msg.author and reaction.message == expired_queue and reaction.emoji in ["1️⃣", "2️⃣","3️⃣","4️⃣","5️⃣"]

#

but it never triggers TwT

maiden fable
#

What's expired_queue?

#

@timber crescent

slate swan
#

like dis?

 if msg:
         await ctx.send(f"You aint a real gamer and dont understand fun it but then to got **{wala}:nexus:**")

        def check(m):
         return  m.content == "A" or m.content == '(A)' or m.content == "a" or m.content == "(a)" and m.channel == channel

        msg = await bot.wait_for('message', check=check)
        else:
         player = ctx.author
         gg = random.randint(100, 150)
         c.execute(f"UPDATE data SET balance = balance+{gg} WHERE ID = {player.id}")
         conn.commit()
         await ctx.send(f"You Are A Real Gamer **{gg}:nexus:** as Gift From Every Gamer")
         print(gg)```
upbeat otter
slate swan
#

its highlighting elif as syntax error

upbeat otter
#

i'm blind, where's the elif

slate swan
quick gust
upbeat otter
#

hmm, where's the c coming from?

slate swan
slate swan
upbeat otter
slate swan
upbeat otter
#

mhm I see

slate swan
#

its defined as global variable beacuse its an economy bot

upbeat otter
#

try using exceptions

spring flax
#

does anyone know how to make timestamp markdown in short date/time?

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

discord.utils.format_dt(dt, /, style=None)```
A helper function to format a [`datetime.datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "(in Python v3.9)") for presentation within Discord.

This allows for a locale-independent way of presenting data using Discord specific Markdown...
maiden fable
upbeat otter
#

I'm an old woman now, I need glasses xD

spring flax
#

can i put markdowns in the embed footer?

maiden fable
maiden fable
quick gust
spring flax
#

oof

slate swan
#

you are more blind then eeve

#

look at the first word

maiden fable
#

😐

slate swan
maiden fable
quick gust
slate swan
maiden fable
#

Notice anything?

slate swan
spring flax
maiden fable
#

🤣 I found the mistake

#

And yea, a suggestion

#

Learn again about if statement and functions before continuing

sage otter
#

That has to be the ugliest indentation I’ve ever seen in my life.

maiden fable
#

U r defining a function after the if statement and after that an else block that too with wrong indent 😐

tawdry perch
#

what kind of thumbnail would be good for log embeds?

sage otter
#

Oop wrong reply

#

Do you follow PEP8 tho hunter?

spring flax
#

how do i get the short date/time format? like one of the styles for markdown is <t:unix>
does anyone know?

tawdry perch
#

timestamp unit?

maiden fable
#

This one @tawdry perch ^^^ :D

tawdry perch
#

veri nic3

maiden fable
tawdry perch
sage otter
spring flax
#

nvm got it

tawdry perch
#

oh cool

tawdry perch
maiden fable
tawdry perch
#

sigh

upbeat otter
#

lmaooo

maiden fable
tawdry perch
upbeat otter
#

agreed

spring flax
#

how do i get the unix for a message.created_at object?

upbeat otter
tawdry perch
spring flax
#

oh you mean converter?

tawdry perch
#

ye 😅 (just in case you need to do it many times)

spring flax
#

nope i do not

tawdry perch
#
import datetime
import time
datetime = datetime.datetime(2020, 2, 11, 10, 20)
print("Unix_Time_stamp: ",(time.mktime(datetime.timetuple())))
``` as example this might be what you are looking for?
spring flax
#

but how do i make a message.created_at return object into unix so i can use markdown timestamp

tawdry perch
#

oh return it to object, ehh then I don't know sorry

spring flax
sage otter
#

this is off topic this channel. Consider looking at datetime docs since created_at() returns a datetime object.

maiden fable
#

!d discord.Message.created_at

unkempt canyonBOT
maiden fable
#

O

velvet tinsel
#

Round()?

spring flax
sage otter
#

I’m not sure about that one

velvet tinsel
#

I thought round was inaccurate

sage otter
#

That’s for floats

velvet tinsel
cloud dawn
#

!e ```py
import time
import datetime
d = datetime.date(2015,1,5)

unixtime = time.mktime(d.timetuple())
print(unixtime)

velvet tinsel
#

!e print(round(2.5))

unkempt canyonBOT
#

@velvet tinsel :white_check_mark: Your eval job has completed with return code 0.

2
velvet tinsel
#

See it’s inaccurate

maiden fable
#

Ah got it

unkempt canyonBOT
#

@cloud dawn :white_check_mark: Your eval job has completed with return code 0.

1420416000.0
velvet tinsel
#

It should round to 3

#

!e print(round(2.6))

unkempt canyonBOT
#

@velvet tinsel :white_check_mark: Your eval job has completed with return code 0.

3
velvet tinsel
#

At least THAT works

spring flax
#

so uhmm

#

what do i use?

velvet tinsel
#

For what?

cloud dawn
#

You could use ceil

maiden fable
#

@spring flax

spring flax
#

what's that?

velvet tinsel
#

A bot Hunter made

maiden fable
#

The unix

velvet tinsel
#

I think

#

How did it execute the code?

maiden fable
#

message.created_at.timestamp() returned the unix timestamp @spring flax

velvet tinsel
#

I’m having trouble doing something like that yert

cloud dawn
velvet tinsel
#

I tried exec

#

Okimii and I had trouble

#

With that code 😭 what command?

cloud dawn
velvet tinsel
#

It prints it in the console

#

Doesn’t send it

#

Hypesquad bravery

#

Bad

#

😳

cloud dawn
velvet tinsel
#

I can’t store it in a variable or an as

cloud dawn
#

What are you doing?

velvet tinsel
#

Eval code

cloud dawn
#

I have no idea what that means and where you are stuck on.

velvet tinsel
#

!e import hello

unkempt canyonBOT
#

@velvet tinsel :white_check_mark: Your eval job has completed with return code 0.

Hello world!
velvet tinsel
#

Like that

#

exec() won’t work

cloud dawn
#

!e exec("import hello")

unkempt canyonBOT
#

@cloud dawn :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 |   File "<string>", line 1, in <module>
004 | ModuleNotFoundError: No module named 'hello'
velvet tinsel
#

!e exec("print(“hi”)")

unkempt canyonBOT
#

@velvet tinsel :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 |   File "<string>", line 1
004 |     print(“hi”)
005 |           ^
006 | SyntaxError: invalid character '“' (U+201C)
velvet tinsel
#

!e exec("print() ")

unkempt canyonBOT
#

@velvet tinsel :warning: Your eval job has completed with return code 0.

[No output]
velvet tinsel
#

It prints it but i can’t store in a variable

cloud dawn
#

!e exec("print(somevar)", {"somevar": "hey"})

unkempt canyonBOT
#

@cloud dawn :white_check_mark: Your eval job has completed with return code 0.

hey
#

exec(object[, globals[, locals]])```
This function supports dynamic execution of Python code. *object* must be either a string or a code object. If it is a string, the string is parsed as a suite of Python statements which is then executed (unless a syntax error occurs). [1](https://docs.python.org/3/library/functions.html#id2) If it is a code object, it is simply executed. In all cases, the code that’s executed is expected to be valid as file input (see the section [File input](https://docs.python.org/3/reference/toplevel_components.html#file-input) in the Reference Manual). Be aware that the [`nonlocal`](https://docs.python.org/3/reference/simple_stmts.html#nonlocal), [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield), and [`return`](https://docs.python.org/3/reference/simple_stmts.html#return) statements may not be used outside of function definitions even within the context of code passed to the [`exec()`](https://docs.python.org/3/library/functions.html#exec "exec") function. The return value is `None`.
velvet tinsel
#

So how do I make an eval code?

cloud dawn
#

!source eval

unkempt canyonBOT
#
Command: eval

Run Python code and get the results.

Source Code
velvet tinsel
#

But it won’t help because I can’t change the code

#

😭

cloud dawn
#

Change the code..?

velvet tinsel
#

…exec() only prints

#

It cannot be stored and if it is it’s None

visual island
#

!d contextlib.redirect_stdout

unkempt canyonBOT
#

contextlib.redirect_stdout(new_target)```
Context manager for temporarily redirecting [`sys.stdout`](https://docs.python.org/3/library/sys.html#sys.stdout "sys.stdout") to another file or file-like object.

This tool adds flexibility to existing functions or classes whose output is hardwired to stdout.

For example, the output of [`help()`](https://docs.python.org/3/library/functions.html#help "help") normally is sent to *sys.stdout*. You can capture that output in a string by redirecting the output to an [`io.StringIO`](https://docs.python.org/3/library/io.html#io.StringIO "io.StringIO") object. The replacement stream is returned from the `__enter__` method and so is available as the target of the [`with`](https://docs.python.org/3/reference/compound_stmts.html#with) statement:

```py
with redirect_stdout(io.StringIO()) as f:
    help(pow)
s = f.getvalue()
```  To send the output of [`help()`](https://docs.python.org/3/library/functions.html#help "help") to a file on disk, redirect the output to a regular file...
safe fulcrum
#

!code

unkempt canyonBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

sullen shoal
unkempt canyonBOT
#

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

001 | hello world!
002 | 5
sullen shoal
#

is that what you want

shadow wraith
#

how do i make an if message.content triggered only in a specific channel

shadow wraith
cloud dawn
velvet tinsel
velvet tinsel
#

I like how the beginners bios are like: “DM for bot I’m a dev” while the helpers bios are like “oh no exams” or “I like coding”

velvet tinsel
slate swan
velvet tinsel
#

I’m not jokingni like programming 😭

slate swan
velvet tinsel
#

Good luck on exams

#

What is the subject

slate swan
#

Science

velvet tinsel
#

Oh…good luck (I suck at science)

#

I don’t really like it

slate swan
#

I love science

velvet tinsel
#

Computer science? Yeah jam_cavedude

slate swan
#

No general science

velvet tinsel
#

💀 I don’t like science

#

I mean chemistry is fun

slate swan
velvet tinsel
#

But…meh

#

Computer science is my favourite science

#

What’s your favourite science yert

velvet tinsel
#

I just had biology today

#

What are you learning jam_cavedude

slate swan
#

About rocks🤬

velvet tinsel
#

That’s geography

slate swan
#

No bruh

velvet tinsel
slate swan
#

Types of rocks🤬

velvet tinsel
#

It’s simple af

slate swan
velvet tinsel
sick birch
velvet tinsel
#

Metamorphosis

slate swan
velvet tinsel
velvet tinsel
sick birch
#

They worship Java for some reason

velvet tinsel
#

Metamorphic

slate swan
velvet tinsel
#

Is the other type of rock

#

I’m taking IB in sixth form but they don’t do computer science

sick birch
slate swan
velvet tinsel
sick birch
#

Java is overdue tbh

velvet tinsel
sick birch
#

I mean it taught me the sorting algorithms but that’s about it

sullen shoal
#

i like rust, its beautiful

velvet tinsel
slate swan
sick birch
#

It’s all just JavaScript these days

slate swan
velvet tinsel
sullen shoal
#

: |

slate swan
slate swan
velvet tinsel
sick birch
#

I bet rust has a discord library as well

#

Would be a good starting place perhaps

velvet tinsel
sick birch
#

I’ve seen libraries in the most obscure languages, why not for something relatively mainstream like rust haha

velvet tinsel
#

The thing about other languages are you have to make a class or a function in order to execute code, it’s annoying

slate swan
#

Rust isnt good at all

velvet tinsel
#

In python you just execute it

slate swan
#

Try phppithink

sick birch
#

Then go for functional languages like Haskell

velvet tinsel
sullen shoal
slate swan
#

Jkjkjkjk

#

Php > any language

velvet tinsel
#

🤬🤬

unkempt canyonBOT
velvet tinsel
#

🤬

slate swan
#

Guess ill have to read it😔

sullen shoal
slate swan
sullen shoal
slate swan
slate swan
sage otter
#

just use flask for backend pl0x. no php.

slate swan
sick birch
#

You’re all forgetting bf is the best language

slate swan
sage otter
slate swan
#

Like not the speaking language the actual programming language

sick birch
#

Fair point

slate swan
sick birch
#

Though Python is like speaking English so therefore Python is the best language

slate swan
#

Anybody know whos zyapguy?

sick birch
#

I’ve seen some of his videos but other than that not really

plush cosmos
slate swan
plush cosmos
#

Hello

sick birch
#

👋

plush cosmos
slate swan
#

@sick birch you should watch his new video i think its talking about not known languages and its actually really funny

sick birch
#

Haha I’ll check it out when I’m back from school

plush cosmos
#

He does stackoverflow videos

slate swan
sick birch
#

Stackoverflow is a bit of a cesspool imo lmao

plush cosmos
#

Hello how to print something in python? Here's my code:

print("Hello, World!"

#

LMAO

sick birch
#

“Switch to a real programming language”

plush cosmos
#

I hate these responses

slate swan
plush cosmos
#

Yeh

sick birch
#

I see stuff like that a lot in help channels, here or even on stack overflow, you want to fix B but someone suggests do A

slate swan
#

😭

plush cosmos
#

Stack over flow is just alot of java robots

slate swan
#

Ikr

plush cosmos
#

What language should i start?

sick birch
#

Always C

slate swan
#

Java or c++

plush cosmos
#

People: Start with JAVA and C++

slate swan
#

😭

sick birch
#

At least C is ok Java is just meh

plush cosmos
#

🙃

sick birch
#

Overdone to hell

plush cosmos
#

Whateheck

slate swan
#

"Learn a real language and not a kids language like python learn java or C its not that hard"

plush cosmos
#

"Python is a baby language"

#

OK

slate swan
plush cosmos
#

"Omg very tru"

slate swan
#

"html is the best language"

#

||not a programming language btw||

plush cosmos
#

"PHP ITs the bEzt Languege"

slate swan
#

😭

plush cosmos
#

"ruBy is Bezt Languaege

slate swan
plush cosmos
#

oke its just a joke

slate swan
#

Yeah ik

#

Lmao

plush cosmos
#

I know another way to print hello world without using print

#

import __hello__

tawdry perch
#

sys.stdin? or smth like that afaik

slate swan
plush cosmos
#

U forgot the ";"

#

Nice

slate swan
tawdry perch
#

anyways, wish me luck I will be putting a lot of embeds logging

slate swan
plush cosmos
#

You edited the message and you put ":"

slate swan
#

🤢🤢

plush cosmos
#

I tried this at my python and it works for some reason

slate swan
slate swan
plush cosmos
#

; are cringe watfk

boreal ravine
#

Bruh

slate swan
#

Ive never used ; lmao

#

Only colons

boreal ravine
#

!ot @slate swan @plush cosmos

unkempt canyonBOT
plush cosmos
slate swan
plush cosmos
#

Thank ya

daring olive
#

this isn't a general chat, let's keep the topic on discord bots please

tawdry perch
#

on_bulk_message_delete how can I find the amount of bulked messages?

slate swan
daring olive
slate swan
velvet tinsel
#

Okimii

#

Check the server

#

Mina do be moderating tho

boreal ravine
#

😐

boreal ravine
unkempt canyonBOT
#

discord.on_bulk_message_delete(messages)```
Called when messages are bulk deleted. If none of the messages deleted are found in the internal message cache, then this event will not be called. If individual messages were not found in the internal message cache, this event will still be called, but the messages not found will not be included in the messages list. Messages might not be in cache if the message is too old or the client is participating in high traffic guilds.

If this occurs increase the [`max_messages`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") parameter or use the [`on_raw_bulk_message_delete()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_raw_bulk_message_delete "discord.on_raw_bulk_message_delete") event instead.

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

its a list, use len ig

tawdry perch
#

oh it's messages

boreal ravine
#

yes

tawdry perch
#

ah, let me load the cog and see what happens

#

how may I get the channel those messages been bulked in at?

maiden fable
#

U can do messages[0].channel

#

Since the messages would be deleted in the same channel

tawdry perch
#

ah

#

I did ```py
@commands.Cog.listener("on_bulk_message_delete")
async def bulk_alert(self, messages):
content = await self.modlog.send_log_message(
self, colour=discord.Color.red(), title=f"Alert",
text=f"({len(messages)}) messages have been bulked in {messages[0].channel}", icon_url=discord.Embed.Empty,
footer="Logger webhook"
)

    await ModLog.send_webhook(self, content)
#

there was 6 messaged being purged

maiden fable
#

O

#

Wait

#

@tawdry perch that shows only those messages which are in the cache

tawdry perch
#

hmm

#

I need to use raw

maiden fable
#

Yea

boreal ravine
#

bad

#

!d discord.on_raw_bulk_message_delete

unkempt canyonBOT
#

discord.on_raw_bulk_message_delete(payload)```
Called when a bulk delete is triggered. Unlike [`on_bulk_message_delete()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_bulk_message_delete "discord.on_bulk_message_delete"), this is called regardless of the messages being in the internal message cache or not.

If the messages are found in the message cache, they can be accessed via [`RawBulkMessageDeleteEvent.cached_messages`](https://discordpy.readthedocs.io/en/master/api.html#discord.RawBulkMessageDeleteEvent.cached_messages "discord.RawBulkMessageDeleteEvent.cached_messages")

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

Lol

#

depends

#

no?

#

who said that smh

#

i mean, it does break it technically

#

ig yes

#

low chance it'll be taken down afaik

lament mesa
#

!ytdl

unkempt canyonBOT
#

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

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

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

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

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

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

Old tutorials which some use ytdl which is against tos

tawdry perch
#

how can I get permissions of a role in channel?

maiden fable
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...
tawdry perch
#

ooo

slate swan
#

Spotify and others,they have to be non copy right or you'll break copyright laws

tawdry perch
slate swan
#

hey

tawdry perch
#

hi

slate swan
#
@bot.command()
async def gamer(ctx):
        await ctx.send('You have 2 Choices \n(A)A Baseball Bat With Iron Wires Coverd\n(B)An M16 With 90 Bullets\n what will you choose?')
        channel = ctx.message.channel
        player = ctx.author
        gg = random.randint(100, 150)
        wala = random.randint(50, 100)
        def check(m):
           return m.content in ("A", '(A)', "a", "(a)") and m.channel == channel
        def nocheck(m):
           return m.content == "(B)" or 'b' or 'B' or '(b)' and m.channel == channel
        msg = await bot.wait_for('message', check=check)
        if msg:
            await ctx.send(f"You Are A Real Gamer **{gg}:nexus:** as Gift From Every Gamer")
        else:
          msg = await bot.wait_for('message', check=nocheck)
          await ctx.send(f"You aint a real gamer and dont understand fun it but then to got **{wala}:nexus:**")

the bot is not responding when i typed 'b' or (b) or B or (B)
just responds to a

velvet tinsel
#

I am a mods biggest nightmare

#

💀

tawdry perch
#

inserts !ot

velvet tinsel
#

If hunting the Hunter: print(“!ot”)

slate swan
velvet tinsel
#

What’s the problem

velvet tinsel
slate swan
#

Where?

velvet tinsel
#

I think

#

Where the little ^ is

slate swan
#

Oh

velvet tinsel
#

Hai Okimii 😐

slate swan
slate swan
velvet tinsel
#

bot.get_user()

slate swan
#

🤬

velvet tinsel
#

😳

velvet tinsel
#

I regret being a helper now

slate swan
velvet tinsel
#

Me no like big code on mobile

slate swan
velvet tinsel
#

But I’m just going to say wait_for()

velvet tinsel
velvet tinsel
slate swan
slate swan
velvet tinsel
tawdry perch
velvet tinsel
#

What’s the error

slate swan
tawdry perch
#

Oh I forgot to add it ;-;

velvet tinsel
#

jam_cavedude 🚐💀🤦‍♂️

slate swan
velvet tinsel
#

Damn my phone just fell on the floor and there is a crack 😭

#

RIP

slate swan
slate swan
velvet tinsel
#

Yes

slate swan
#

Makes senseyert

velvet tinsel
#

I meant floor 😭

slate swan
sullen shoal
#

thats why i have tempered glass on my phone

slate swan
slate swan
sullen shoal
#

nice

slate swan
#

anyone?

slate swan
sullen shoal
velvet tinsel
#

😂

velvet tinsel
#

Poor floor

slate swan
#

🤬 pithink

slate swan
sullen shoal
#

msg is the discord.Message you were waiting for. what do you think you're doing in that if statement?

maiden fable
velvet tinsel
#

Wait I have screen protector

#

😂😂 it didn’t brea

tawdry perch
velvet tinsel
#

Yes

maiden fable
#

You need a text channel instance

tawdry perch
#

I got it

slate swan
tawdry perch
#

and passed role to it

maiden fable
#

ctx.channel.permissions_for(ctx.guild.roles[1])

sullen shoal
slate swan
#

and was like alr just add if and else and start pressing spaces and tabs

tawdry perch
tawdry perch
#

not in this way tho

maiden fable
#

ctx.permissions_for() would also work

slate swan
tawdry perch
maiden fable
#

Huh? Lemme try that

velvet tinsel
#

Yay not break

sullen shoal
maiden fable
sullen shoal
slate swan
maiden fable
#

How r u using the command?

tawdry perch
#

!get_permissions <id_of_role>

slate swan
#

i have dis

        def good(m):
           return m.content in ("A", '(A)', "a", "(a)") and m.channel == channel
        def wrong(m):
           return m.content == "(B)" or 'b' or 'B' or '(b)' and m.channel == channel```
sullen shoal
#

merge them

maiden fable
#

Try mentioning it

slate swan
sullen shoal
#

if m.content in (a,b,(a),(b))

tawdry perch
sullen shoal
#

later do,
if msg.content in (a, (a)) ...

#

i didnt make them strings because im lzy

tawdry perch
slate swan
#

look at the full code (just in case)

@bot.command()
async def gamer(ctx):
        await ctx.send('You have 2 Choices \n(A)A Baseball Bat With Iron Wires Coverd\n(B)An M16 With 90 Bullets\n what will you choose?')
        channel = ctx.message.channel
        player = ctx.author
        gg = random.randint(100, 150)
        wala = random.randint(50, 100)
        def good(m):
           return m.content in ("A", '(A)', "a", "(a)") and m.channel == channel
        def wrong(m):
           return m.content == "(B)" or 'b' or 'B' or '(b)' and m.channel == channel
        msg = await bot.wait_for('message', check=good)
        if msg:
            await ctx.send(f"You Are A Real Gamer **{gg}:nexus:** as Gift From Every Gamer")
        else:
          msg = await bot.wait_for('message', check=wrong)
          await ctx.send(f"You aint a real gamer and dont understand fun it but then to got **{wala}:nexus:**")
maiden fable
sullen shoal
maiden fable
#
@bot.command()
async def get_perms(self, ctx, role: discord.Role):
        a = ctx.channel.permissions_for(role)
        await ctx.send(a) 
slate swan
#

i didnt knew i can use 1 bot.wait_for for 2 ctx.send

sullen shoal
#

looks like you're really confused what you are even doing

sullen shoal
#

by yourself

maiden fable
sullen shoal
#

because its wrong

slate swan
tawdry perch
slate swan
#

okay thats a good idea ty

maiden fable
#

@tawdry perch

tawdry perch
#

wtf

slate swan
#

i ned help

sullen shoal
#

oof

tawdry perch
maiden fable
tawdry perch
#

how did it work for you

slate swan
#

Any who can help me with music bot

maiden fable
maiden fable
unkempt canyonBOT
#

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

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

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

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

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

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

🤷‍♂️ No help since it's against ToS, sorry

tawdry perch
slate swan
maiden fable
tawdry perch
#

;-;

maiden fable
#

Try using disnake?

tawdry perch
#

no

#

forbidden move

maiden fable
#

Why tho

slate swan
tawdry perch
#

because I'm not yet done for a move

slate swan
tawdry perch
#

@slate swan we can't help you with music bots

slate swan
#

dm or here?

maiden fable
slate swan
#

alr

tawdry perch
#

!rule 5 to be specific

unkempt canyonBOT
#

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

maiden fable
#

Or u can also do import disnake as discord

tawdry perch
#

but it will mess up with dpy lib.. (if imported as discord)

maiden fable
#

And who says that?

#

I have both dpy and disnake installed on my PC

maiden fable
#

Which ide u using?

tawdry perch
#

vsc

sullen shoal
#

even notepad has find and replace feature

tawdry perch
maiden fable
#

CTRL Shift F and select all the instances of discord to disnake after selecting everything with CTRL D

tawdry perch
#

I'll try to find another way to fix the code

maiden fable
#

I tried your code, literally in front of u and it works perfectly on disnake

slate swan
#

Disnake gets access by disnake and dpy gets accessed by discord so really shouldn't raise a error

maiden fable
#

Facts

tawdry perch
#

gib command to install disnake as discord

slate swan
#
import disnake as discord

You can do this but its bad practice

tawdry perch
#

what is the better way

maiden fable
slate swan