#discord-bots

1 messages ยท Page 679 of 1

cloud dawn
#

Its good.

lyric moat
#

whats that

#

the way u make that face is sus

cloud dawn
lyric tusk
#

when you typt your id its it the server one? ore my

valid barn
small igloo
slate swan
sage otter
#

Honestly I didnโ€™t like it at first either. But I learned it can be extremely powerful. So yeah

lyric tusk
slate swan
valid barn
cloud dawn
lyric tusk
small igloo
cloud dawn
slate swan
cerulean osprey
small igloo
slate swan
#

Hey here is my code

    @commands.Cog.listener()
    async def on_guild_channel_update(self,before,after):
        disabled = await self.coll.find_one({"Enabled": "False"})
        if disabled:
            return
        else:
            if before.position == after.position:
                print("Position didnt change")
                return
            else:
                print(before.position)
                print(after.position)
                await after.edit(position = before.position, reason = "Channel moved when lock was enabled")

I know for a fact that channels arent really moving but my console is being spammed with position prints (Suprisingly looks like before.position and after.position is same) however looks like the return and print("position didnt change") isnt firing

small igloo
sage otter
#

You can still keep this in a one liner. Just swap in this
for r in bot.get_guild(id).get_member(id).roles
I think???

valid barn
sinful pasture
#
  if message.content.startswith('Dadjoke!'):
    dadjoke = Dadjoke()
    await message.channel.send(dadjoke)

have i got like no brains or wat

sinful pasture
#

ok looks like im a dumb fuck

cloud dawn
#
  if message.content.startswith('Dadjoke!'):
    await message.channel.send(Dadjoke())
sinful pasture
#

adios moment

sinful pasture
#

i tried that

cloud dawn
#

Still the same?

sinful pasture
#

it gives error when i do command

#

oh wait

cloud dawn
#

At this point if you'd maken your own you would've been done already ๐Ÿ˜‚

sinful pasture
#

k lemme try this other thing'

slate swan
#
dadjoke = Dadjoke()
  if message.content.startswith('Dadjoke!'):
    await message.channel.send(datajoke.joke)``` thank me later
lyric tusk
slate swan
#

the pypi page :

sinful pasture
#

still doesnt work

sinful pasture
#

<dadjokes.dadjokes.Dadjoke object at ithinkthisisIP>

slate swan
slate swan
sinful pasture
slate swan
#

your current code?

sinful pasture
#
@client.event
async def on_message(message):
  if message.content.startswith('Dadjoke!'):
    await message.channel.send(Dadjoke())
slate swan
sinful pasture
small igloo
#

burh is pip install is so long or what

quaint epoch
#

so, is it possible to fetch a user, then using that member object to check who they receive dm's from?

sinful pasture
quaint epoch
cerulean osprey
#

How would I make the bot delete a command after it was sent?

sinful pasture
#

im stoopid

#

thanks for clarifying

slate swan
slate swan
cerulean osprey
#

Ty

slate swan
#

You can use the delete_after=int kwarg if you want as well

#

that deletes the message sent by bot

#

and the first one deletes the user's message

slate swan
slate swan
#

Hey here is my code

    @commands.Cog.listener()
    async def on_guild_channel_update(self,before,after):
        disabled = await self.coll.find_one({"Enabled": "False"})
        if disabled:
            return
        else:
            if before.position == after.position:
                print("Position didnt change")
                return
            else:
                print(before.position)
                print(after.position)
                await after.edit(position = before.position, reason = "Channel moved when lock was enabled")

I know for a fact that channels arent really moving but my console is being spammed with position prints (Suprisingly looks like before.position and after.position is same) however looks like the return and print("position didnt change") isnt firing

slate swan
#

await ctx.message.delete() will delete user's message
delete_after=int delete's the bot's message

small igloo
#

breh why my pip install dotenv taking so longggg

slate swan
#

why even install it

#

!d os.getenv just use this

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.
limber cosmos
#

How can I remove a user's reaction to a message?

Current code:

@bot.event
async def on_raw_reaction_add(payload):
    reaction = str(payload.emoji)
    msg_id = payload.message_id
    ch_id = payload.channel_id
    user_id = payload.user_id
    guild_id = payload.guild_id
    server = bot.get_guild(guild_id)
    member = server.get_member(user_id)
    
    await msg_id.remove_reaction("โœ๏ธ")```
Error:
```diff
-AttributeError: 'int' object has no attribute 'clear_reaction```
cloud dawn
#

dotenv is imported but it isn't the pypi

#

!pypi python-dotenv

unkempt canyonBOT
cloud dawn
unkempt canyonBOT
#

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

Remove a reaction by the member from the message.

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

If the reaction is not your own (i.e. `member` parameter is not you) then the [`manage_messages`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_messages "discord.Permissions.manage_messages") permission is needed.

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

It takes a message object not id.

spark sentinel
#

hello,
I would like to get a link from a text, how can I best do it ?

shadow wraith
#

took me 17 lines of code to implement a mute command

limber cosmos
cloud dawn
limber cosmos
spark sentinel
shadow wraith
#

imo this code looks good?

@bot.command()
@commands.guild_only()
@commands.has_any_role('Official Owner', 'Admins')
async def mute(ctx, member: discord.Member, *, time: int):
    # vars
    guild = member.guild
    mute_role = guild.get_role(918153988573106187)
    # add mute
    await member.add_roles(mute_role)
    # convert to epoch
    today_obj = datetime.datetime.today()
    date_timestamp = datetime.datetime(today_obj.year, today_obj.month, today_obj.day, today_obj.hour, today_obj.minute, time)
    # discord msg
    warnmsg = await ctx.reply(":incoming_envelope::ok_hand: Applied mute to {0} for <t:{1}:R> ({2} seconds if the time displayed is incorrect) seconds".format(member.mention, calendar.timegm(date_timestamp.timetuple()), time))
    # remove mute role after given time
    await asyncio.sleep(int(time))
    await member.remove_roles(mute_role)
    if today_obj.second > time:
        # if time bigger than the time specified itzelf
        await warnmsg.edit(content=":incoming_envelope::ok_hand: Applied mute to {0} since <t:{1}:R> ({2} seconds if the time displayed is incorrect) seconds".format(member.mention, calendar.timegm(date_timestamp.timetuple()), time)) 
cloud dawn
cloud dawn
shadow wraith
#

๐Ÿ’€

upbeat otter
#

take out the check parameter

slate swan
#

like this

@bot.command()
async def buttton(ctx):
  await ctx.send(
    'This is a button',
    components = [
      Button(label= 'Click Me!')
    ]
  )
  print('part one')
  interaction = await bot.wait_for("button_click", i: i.component.label.startswith('Click'))
  if interaction.user.id == ctx.author.id:
    await interaction.send(content="Button Clicked")

?

lyric tusk
spark sentinel
cloud dawn
upbeat otter
cloud dawn
cloud dawn
upbeat otter
#
if interaction.component.label == component.label:
    #whatever```
slate swan
slate swan
shadow wraith
#

oh yeah and that <t::r> thing, if you put a number between the : you can make a time like this: <t:4934:R>

slate swan
#

im dying

spark sentinel
upbeat otter
#
@bot.command()
async def buttton(ctx):
  await ctx.send(
    'This is a button',
    components = [
      Button(label= 'Click Me!')
    ]
  )
  print('part one')
  interaction = await bot.wait_for("button_click")
  if interaction.user.id == ctx.author.id and interaction.channel.id == ctx.channel.id and   interaction.component.label.startswith("Click"): 
  await interaction.send(content="Button Clicked")

@slate swan

upbeat otter
slate swan
#

Hey here is my code

    @commands.Cog.listener()
    async def on_guild_channel_update(self,before,after):
        disabled = await self.coll.find_one({"Enabled": "False"})
        if disabled:
            return
        else:
            if before.position == after.position:
                print("Position didnt change")
                return
            else:
                print(before.position)
                print(after.position)
                await after.edit(position = before.position, reason = "Channel moved when lock was enabled")

I know for a fact that channels arent really moving but my console is being spammed with position prints (Suprisingly looks like before.position and after.position is same) however looks like the return and print("position didnt change") isnt firing

quick gust
upbeat otter
small igloo
quick gust
cloud dawn
lyric tusk
unkempt canyonBOT
#

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

['https://hallo/yes/lol/hax.php']
slate swan
#

i know how to do buttons but no the response

upbeat otter
quick gust
cloud dawn
slate swan
# quick gust okay, let's do this again, send what u have right now
@bot.command()
async def buttton(ctx):
  await ctx.send(
    'This is a button',
    components = [
      Button(label= 'Click Me!')
    ]
  )
  print('part one')
  interaction = await bot.wait_for("button_click")
  print("part two")
  if interaction.user.id == ctx.author.id and interaction.channel.id == ctx.channel.id and   interaction.component.label.startswith("Click"): 
    await interaction.send(content="Button Clicked")
    print("part 3")
quick gust
#

Yeah so much did infact copy it

#

interaction.component.label.startswith("")

#

edit this

slate swan
#

?

cloud dawn
#

Someone ghost pinged me rooCop

quick gust
#

to what your label says

slate swan
#

kk

quick gust
#

Your label is Click Me! and not Click

slate swan
#

oh its Click Me!

#

y now i saw it

quick gust
#

yeah u just copied the code

#

lmao

small igloo
#

eh why dotenv not defined yet

oak warren
#

maybe install it

#

again

small igloo
slate swan
#

restart vsc thats it

slate swan
small igloo
cloud dawn
sweet geyser
#

so i made a discord bot which gives the faces of a minecraft skin from file

#

but i can't figure out to extend the size of the image

#

This is the result

oak warren
sweet geyser
#

i tried resizing

slate swan
oak warren
cloud dawn
quick gust
slate swan
# quick gust yeah u just copied the code
@bot.command()
async def buttton(ctx):
  await ctx.send(
    'This is a button',
    components = [
      Button(label= 'button')
    ]
  )
  print('part one')
  interaction = await bot.wait_for("button_click")
  print("part two")
  if interaction.user.id == ctx.author.id and interaction.channel.id == ctx.channel.id and   interaction.component.label.startswith("button"): 
    await interaction.send(content="Button Clicked")
    print("part 3")


slate swan
cloud dawn
sweet geyser
oak warren
#

pil

slate swan
#

if the part from where you get the image does not allow you to resize it

quick gust
#

!pypi PIL

unkempt canyonBOT
sweet geyser
#

i used pil to resize

cloud dawn
sweet geyser
upbeat otter
sweet geyser
#

My idea is to manually draw the pixels

slate swan
slate swan
cloud dawn
slate swan
#

@upbeat otterthis?

@bot.command()
async def buttton(ctx):
  await ctx.send(
    'This is a button',
    components = [
      Button(label= 'button')
    ]
  )
  print('part one')
  interaction = await bot.wait_for("button_click")
  print("part two")
  if interaction.user.id == ctx.author.id and interaction.channel.id == ctx.channel.id and interaction.component.label == "button": 
    await interaction.send(content="Button Clicked")
    print("part 3")
sweet geyser
#

i kinda got horrified by the result though

#

it just scared me

#

I was expecting this

slate swan
slate swan
upbeat otter
sweet geyser
#

Using requests

slate swan
sweet geyser
slate swan
slate swan
#

oh

upbeat otter
slate swan
sweet geyser
#

Ye?

#

using urls

slate swan
#

You know request isnt async right

sweet geyser
upbeat otter
#

@slate swanuse try and except on bot.wait_for

sweet geyser
#

I go by if it works it works thing

slate swan
slate swan
sweet geyser
#

But its just testing for now

#

Just the image part but

slate swan
cloud dawn
sweet geyser
#

I used a tutorials point for example

slate swan
slate swan
# upbeat otter <@456226577798135808>use try and except on bot.wait_for
@bot.command()
async def buttton(ctx):
  await ctx.send(
    'This is a button',
    components = [
      Button(label= 'button')
    ]
  )
  print('part one')
  try:
    interaction = await bot.wait_for("button_click")
    print("part two")
  except:
    if interaction.user.id == ctx.author.id and interaction.channel.id == ctx.channel.id and interaction.component.label == "button": 
     await interaction.send(content="Button Clicked")
     print("part 3")
cloud dawn
spark sentinel
upbeat otter
cloud dawn
#

Be aware of what you want.

small igloo
#

ummm...?

spark sentinel
upbeat otter
small igloo
cloud dawn
upbeat otter
small igloo
spark sentinel
#

haha

slate swan
# upbeat otter nooooo ```py except Exception as e: print(e) #indent the rest code properly ...
@bot.command()
async def buttton(ctx):
  await ctx.send(
    'This is a button',
    components = [
      Button(label= 'button')
    ]
  )
  print('part one')
  try:
    interaction = await bot.wait_for("button_click")
  except Exception as e:

    print(e)
  if interaction.user.id == ctx.author.id and interaction.channel.id == ctx.channel.id and interaction.component.label == "button": 
    await interaction.send(content="Button Clicked")
    print("part 3")
spark sentinel
twilit briar
#

Noob here.

    if "1" in message.content:
        await message.reply("1234")

How can I make the bot ignore this if the '1' is in a link or in a user's ID?

slate swan
#

This interaction failed

cloud dawn
# spark sentinel yeah but how should i filter this, i am overstrain
import re

string = 'test url lol hahaha https://hallo/yes/lol/hax.php no this is lol https://google.com/'

if match := re.findall(r'(?:(?:https?|ftp):\/\/)?[\w/\-?=%.]+\.[\w/\-&?=%.]+', string):
    urls = ", ".join([url for url in match if url.startswith('https://hallo/') or url.startswith('https://www.hallo/')])
slate swan
small igloo
spark sentinel
upbeat otter
upbeat otter
#

show the print

gloomy cloud
#

can some one tell me pls help code

spark sentinel
upbeat otter
slate swan
upbeat otter
slate swan
#

just this

upbeat otter
small igloo
#

help...?

slate swan
#

and code :

@bot.command()
async def buttton(ctx):
  await ctx.send(
    'This is a button',
    components = [
      Button(label= 'button')
    ]
  )
  print('part one')
  try:
    interaction = await bot.wait_for("button_click")
  except Exception as e:

    print(e)
  if interaction.user.id == ctx.author.id and interaction.channel.id == ctx.channel.id and interaction.component.label == "button": 
    await interaction.send(content="Button Clicked")
    print("part 3")
upbeat otter
#

give me a minute

slate swan
#

okay'

spark sentinel
upbeat otter
#

@slate swan

slate swan
#

how

#

is my code?

upbeat otter
#

idk?

cloud dawn
# spark sentinel which should i use 3.8.2 oder idh 3.8.10

As high as possible

import re

string = 'test url lol hahaha https://hallo/yes/lol/hax.php no this is lol https://google.com/'

if match := re.findall(r'(?:(?:https?|ftp):\/\/)?[\w/\-?=%.]+\.[\w/\-&?=%.]+', string):
    urls = ", ".join([url for url in match if re.search(r'(?:(?:https?|ftp):\/\/)[w+?]?[w]?[w]?[.]?hallo\/', url)])
``` Also updated this to get a more accurate search.
upbeat otter
#

your wait_for is not working

slate swan
upbeat otter
cloud dawn
#

Regex py_strong

slate swan
upbeat otter
slate swan
upbeat otter
slate swan
#

how is this possible fr

#

๐Ÿ˜‚

cloud dawn
quick gust
#

it's working for the pokemon eevee but not him

cloud dawn
#

Ah well i'm using disnake so i'm good

slate swan
cloud dawn
#

Basically trial and error.

slate swan
#

Trial?you mean

cloud dawn
slate swan
#

I think im going to buy nitro this monthpithink

slate swan
cloud dawn
quick gust
slate swan
#

๐Ÿšถ

slate swan
quick gust
#

!ot

unkempt canyonBOT
quick gust
#

heh

cloud dawn
#

You guys talking about ot is pretty ot

slate swan
upbeat otter
slate swan
quick gust
cloud dawn
#

Could you guys please go to ot

slate swan
#

OT

slate swan
#

!ot

cloud dawn
upbeat otter
slate swan
cloud dawn
#

@solar magnet Sup

upbeat otter
#

bet

#

lol

slate swan
#

@upbeat otter any problem with python?

cloud dawn
upbeat otter
#

anyways

slate swan
upbeat otter
#

!ot too much

unkempt canyonBOT
cloud dawn
#

Assigning variables: Course 1

cloud dawn
slate swan
slate swan
cloud dawn
#

nissan r34 ... lol

slate swan
#

Yespithink

cloud dawn
#

No way that is an actual car right?

slate swan
#

It is lmfao

cloud dawn
#

rule 34 community

slate swan
#

Nissan r34 skyline

slate swan
#

I could dm you a pic of the car if you want

cloud dawn
#

Sure

spark sentinel
tacit horizon
#

dam

cloud dawn
spark sentinel
cloud dawn
slate swan
spark sentinel
slate swan
#

I can hit any aerial ofc๐Ÿ˜‰

cloud dawn
slate swan
slate swan
#

So yeah mb

cloud dawn
#

I use kb/m so i use pc :)

slate swan
cloud dawn
#

Thanks

slate swan
#

Normal people play rl in controller ๐Ÿ•ด๏ธ

cloud dawn
#

Well i'm not like everyone else.

slate swan
cloud dawn
velvet tinsel
#

!ot

unkempt canyonBOT
cloud dawn
slate swan
upbeat otter
#
import disnake as nextcord
import nextcord as discord
import discord as disnake
from discord.ext import commands

bot = commands.Bot(command_prefix="!", intents=discord.Intents.all())

bot.command()
async def smh(ctx: discord.Context):
  embed = nextcord.embed(color=ctx.message.author.color)
  await ctx.send(embed=embed)

bot.run(disnake.generate_a_token_so_so_random_nobody_ever_seen_it)
#

why isnt this working?

velvet tinsel
velvet tinsel
#

Whatโ€™s wrong

upbeat otter
velvet tinsel
#

Is there an error

upbeat otter
upbeat otter
upbeat otter
cloud dawn
#

I actually need to make a cursed bot so cursed that people will want to figure it out how it works.

upbeat otter
cloud dawn
upbeat otter
#

I'm bad reading

slate swan
#
import disnake as discord
import discord as nextcord
import nextcord as pycord
import pycord as lefi
from disnake import *
import asyncio,datetime

Pep 8 is screaming rn

velvet tinsel
#

Youโ€™re not being clear

#

Is there anything wrong

cloud dawn
#

Have you tried restarting the script?

slate swan
velvet tinsel
#

What is wrong, is the bot not responding or what lmao

cloud dawn
slate swan
slate swan
velvet tinsel
#

You have to do disnake.ext @upbeat otter

upbeat otter
#
import disnake as nextcord
import nextcord as discord
import discord as disnake
import pycord as bot
from discord.ext import commands

bot = commands.Bot(command_prefix="!", intents=discord.Intents.all())

bot.command()
async def smh(ctx: discord.Context):
  embed = nextcord.embed(color=ctx.message.author.color)
  await ctx.send(embed=embed)

bot.run(disnake.generate_a_token_so_so_random_nobody_ever_seen_it())

I did this now

cloud dawn
upbeat otter
cloud dawn
slate swan
cloud dawn
slate swan
slate swan
cloud dawn
upbeat otter
slate swan
upbeat otter
slate swan
#

Im the best programmer watch

upbeat otter
#
try:
import disnake as nextcord
import nextcord as discord
import discord as disnake
import pycord as bot
from discord.ext import commands

bot = commands.Bot(command_prefix="!", intents=discord.Intents.all())

bot.command()
async def smh(ctx: discord.Context):
  embed = nextcord.embed(color=ctx.message.author.color)
  await ctx.send(embed=embed)

bot.run(disnake.generate_a_token_so_so_random_nobody_ever_seen_it())
except Exception as e:
  cout >> e >> endl;
  return 0;
#

like this?

#

@cloud dawn

slate swan
#

!e

exec(print("told you"))
unkempt canyonBOT
#

@slate swan :x: Your eval job has completed with return code 1.

001 | told you
002 | Traceback (most recent call last):
003 |   File "<string>", line 1, in <module>
004 | TypeError: exec() arg 1 must be a string, bytes or code object
slate swan
#

๐Ÿƒโ€โ™‚๏ธ

#

Im so bored please someone help๐Ÿ˜ญ

upbeat otter
slate swan
#

We should make a server and play kahoot later about python

upbeat otter
slate swan
cloud dawn
#

i was thinking about ```py
exec("try: \nmport disnake as nextcord\nimport nextcord as discord\nimport discord as disnake\nimport pycord as bot\nfrom discord.ext import commands\nbot = commands.Bot(command_prefix='!', intents=discord.Intents.all())\nbot.command()\nasync def smh(ctx: discord.Context):\n\nembed = nextcord.embed(color=ctx.message.author.color)\n\nawait ctx.send(embed=embed)\nbot.run(disnake.generate_a_token_so_so_random_nobody_ever_seen_it())\nexcept Exception as e:\ncout >> e >> endl;\nreturn 0;")

slate swan
#

๐Ÿ˜ณ

cloud dawn
#

!e ```py
exec("try: \nmport disnake as nextcord\nimport nextcord as discord\nimport discord as disnake\nimport pycord as bot\nfrom discord.ext import commands\nbot = commands.Bot(command_prefix='!', intents=discord.Intents.all())\nbot.command()\nasync def smh(ctx: discord.Context):\n\nembed = nextcord.embed(color=ctx.message.author.color)\n\nawait ctx.send(embed=embed)\nbot.run(disnake.generate_a_token_so_so_random_nobody_ever_seen_it())\nexcept Exception as e:\ncout >> e >> endl;\nreturn 0;")

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 2
004 |     mport disnake as nextcord
005 |     ^
006 | IndentationError: expected an indented block after 'try' statement on line 1
slate swan
cloud dawn
#

lol no way im gonna debug this shit

upbeat otter
cloud dawn
#

Any mod hopping in rn would be so confused ๐Ÿ˜‚

quick gust
#

I'm not a mod but I am confused

slate swan
#

Im having a stroke

cloud dawn
quick gust
#

Heh

upbeat otter
#
const discord = require("disnake");
const nextcord = require("discord");
const disnake = require("nextcord");
from discord.ext import commands
bot = commands.Bot(command_prefix="!", intents=discord.Intents.all());
bot.command();
async def smh(ctx: discord.Context){
  embed = nextcord.embed(color=ctx.message.author.color);
  await ctx.send(embed=embed);
}
bot.run(disnake.generate_a_token_so_so_random_nobody_ever_seen_it());

this is fine? @cloud dawn

cloud dawn
#

1 hour ago it was like instantly 8 people asked for help and now the whole chat just died.

slate swan
#

What the heck is const

upbeat otter
quick gust
#

it's js

upbeat otter
slate swan
#

Oh

cloud dawn
slate swan
upbeat otter
cloud dawn
upbeat otter
#

nvm, I'll just stop now

cloud dawn
slate swan
upbeat otter
spiral swift
#

!E

unkempt canyonBOT
#
Command Help

!eval [code]
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!*

upbeat otter
slate swan
cloud dawn
#

I could also start referring people as it

upbeat otter
#

welcome

upbeat otter
slate swan
upbeat otter
#

lol

cloud dawn
#

Is a lemon considered male or female?

quick gust
#

!ot

unkempt canyonBOT
slate swan
cloud dawn
#

Gotta ask the french now

quick gust
#

heh

slate swan
upbeat otter
#

lol

slate swan
#

Lemon are great

upbeat otter
#

You guys put a smile on my face everytime

quick gust
slate swan
upbeat otter
cloud dawn
#
Why does everything in French have genders?

Basically, gender in languages is just one way of breaking up nouns into classes. In fact, according to some linguists, โ€œgrammatical genderโ€ and โ€œnoun classโ€ are the same thing. It's an inheritance from our distant past. Researchers believe that Proto-Indo-European had two genders: animate and inanimate.
slate swan
spark sentinel
#

@cloud dawn can you help me again haha
i split sth but then it gives me ['text', 'text'] how can i do that it gives me only the text

quick gust
quick gust
cloud dawn
upbeat otter
#

!ot

unkempt canyonBOT
cloud dawn
spark sentinel
slate swan
spark sentinel
cloud dawn
#

!d str.join

unkempt canyonBOT
#

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

I think they are translating from some language

cloud dawn
slate swan
quick gust
upbeat otter
slate swan
quick gust
cloud dawn
#

!e ```py
res = ['hello it's me', '..dnafinaf']

print(" ".join(res))

unkempt canyonBOT
#

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

hello it's me ..dnafinaf
slate swan
quick gust
#

ok u deleted it

cloud dawn
#

Guys please do keep it polite here.

slate swan
#

๐Ÿ•ด๏ธ

quick gust
#

whatever floats ur- nvm

quick gust
slate swan
cloud dawn
#

Well then, how much is he paying her

slate swan
#

Gawd dayum chill๐Ÿ˜ญ

quick gust
cloud dawn
slate swan
cloud dawn
#

Still seems like a bribe

quick gust
#

chill

slate swan
unkempt canyonBOT
spark sentinel
sick birch
#

my brain

upbeat otter
slate swan
tacit horizon
quick gust
#

cause I didn't understand what that meant

cloud dawn
#

Ouch

slate swan
#

So rude

quick gust
#

use deepl translate instead if you're using Google translate

slate swan
#

Lol

#

Im learning sql pithink

quick gust
cloud dawn
#

i'm pretty sure i have mastered sql

slate swan
cloud dawn
slate swan
slate swan
tacit horizon
#

what is the discord help command

slate swan
cloud dawn
quick gust
#

what do you mean

slate swan
quick gust
#

huh?

cloud dawn
#

You guys are going to make me miss my nitro in 3 days๐Ÿ˜ฅ

slate swan
#

!d discord.Message.remove_reaction

unkempt canyonBOT
#

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

Remove a reaction by the member from the message.

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

If the reaction is not your own (i.e. `member` parameter is not you) then the [`manage_messages`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_messages "discord.Permissions.manage_messages") permission is needed.

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

ya

quick gust
#

!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.
slate swan
#

Well msgs from docs start with !d

sick birch
#

Upload it as an emoji

quick gust
sick birch
#

And use that in the button

quick gust
#

and it's the psuedocode

slate swan
tacit horizon
#

okimii u made bot

slate swan
tacit horizon
slate swan
slate swan
#

๐Ÿ˜ณ

slate swan
tacit horizon
slate swan
#

Nah jit tripping

#

what

slate swan
cloud dawn
slate swan
#

๐Ÿ˜

cloud dawn
slate swan
tacit horizon
slate swan
#

@slate swan not so Christian now, are you

#

๐Ÿ˜ณ

slate swan
slate swan
#

i am trying to make a giveaway command
its just that the bot deletes in 2seconds instead of timer provided

@bot.command()
async def gstart(ctx, duration=None, *, prize=None):
    if duration == None:
        return await ctx.send('timer?')
    elif prize == None:
        return await ctx.send('prize?')
    embed = discord.Embed(title=f'{prize}', description=f'**hosted by {ctx.author.mention}**', color=0xcf244)
    time_covert = {"s":1, "m":60, 'h':3600, 'd':86400}
    gaw_time = int(duration[0]) * time_covert[duration[-1]]
    embed.add_field(name=f'React With ๐ŸŽ‰ To Enter', value=f'Ends in {duration}')
    gaw_msg = await ctx.send(embed=embed)
    await gaw_msg.add_reaction('๐ŸŽ‰')
    await asyncio.sleep(gaw_time)

    gaw_msg2 = await ctx.channel.fetch_message(gaw_msg.id)

    users = await gaw_msg2.reactions[0].users().flatten()
    users.pop(users.index(bot.user))


    if len(users) == 0:
        await gaw_msg2.delete()
        return await ctx.send('no one enter sad')
    else:
     winner = random.choice(users)
     await ctx.send(f'{winner.mention} and won {prize}')```
no error or anything
cloud dawn
#

Whomever uses asyncio sleep to make giveaway, mute, ban and other temp commands: Please don't do this, it will break once restarted.

slate swan
cloud dawn
quick gust
#

I can't even resort to using a db for anything till I figure out how to fix my problem on my vps

slate swan
maiden fable
cloud dawn
maiden fable
#

Well no one got a better way than this ngl

slate swan
#

Ok thxpithink

maiden fable
#

Check them every second or 5 idk

slate swan
slate swan
#

top quality solutions

cloud dawn
#

Well essentially a task is the same as time.sleep but a task is way more flexible and unlike a command can be restored.

slate swan
#

Yeah

maiden fable
cloud dawn
slate swan
cloud dawn
#

Aww rooLove

slate swan
bitter halo
slate swan
#

So discord bots๐Ÿ•ด๏ธ

#

Arent they wonderful

slate swan
cloud dawn
slate swan
slate swan
velvet tinsel
#

If youโ€™re bad itโ€™s hell

velvet tinsel
#

or her

#

๐Ÿ˜ณ

slate swan
cloud dawn
#

<t:1460558760>

slate swan
cloud dawn
# slate swan ?

I needed to see if the format was ok, rest assured i still knew it

cloud dawn
slate swan
cloud dawn
slate swan
cloud dawn
#

Nope lol

slate swan
#

Its rocket league on mobile

slate swan
#

And its official you should check it out

cloud dawn
velvet tinsel
#

You donโ€™t even put a space between the hashtag and your comment

#

๐Ÿ•ด๏ธ

slate swan
slate swan
#

You dont add a space before a cumment

velvet tinsel
#

You do

cloud dawn
#

pep8 says so

maiden fable
unkempt canyonBOT
upbeat otter
#

the greatest programmer

slate swan
#

Only thing on pep8 i dont follow

cloud dawn
maiden fable
velvet tinsel
#

I like splitgate

maiden fable
velvet tinsel
upbeat otter
slate swan
velvet tinsel
#

!ot

slate swan
#

how do I use message.content and delete the message like

user: sends a discord link
bot: deletes

velvet tinsel
#

await message.delete

maiden fable
velvet tinsel
#

Or whatever the message you sent is

maiden fable
slate swan
cloud dawn
slate swan
#

like delete only if its a discord inv link

upbeat otter
slate swan
#

@velvet tinsel you dont even follow pep8 your indentations are worst than a 3 year olds๐Ÿ•ด๏ธ

cloud dawn
slate swan
slate swan
upbeat otter
maiden fable
#

U can simply use if "discord.gg" n message.content

slate swan
#

If I wanted to get the user's access token, would I most of the time have to redirect them to a website?

upbeat otter
slate swan
cloud dawn
#
INVITE_RE = re.compile(
    r"(discord([\.,]|dot)gg|"                     # Could be discord.gg/
    r"discord([\.,]|dot)com(\/|slash)invite|"     # or discord.com/invite/
    r"discordapp([\.,]|dot)com(\/|slash)invite|"  # or discordapp.com/invite/
    r"discord([\.,]|dot)me|"                      # or discord.me
    r"discord([\.,]|dot)li|"                      # or discord.li
    r"discord([\.,]|dot)io|"                      # or discord.io.
    r"((?<!\w)([\.,]|dot))gg"                     # or .gg/
    r")([\/]|slash)"                              # / or 'slash'
    r"(?P<invite>[a-zA-Z0-9\-]+)",                # the invite code itself
    flags=re.IGNORECASE
)
upbeat otter
slate swan
#

!regex

slate swan
#

@unkempt canyon

upbeat otter
slate swan
#

whats regex?

slate swan
upbeat otter
upbeat otter
cloud dawn
maiden fable
slate swan
slate swan
proper acorn
#

How to run client.command and bot.command for my bot? I cant run that for my bot. I can only run 1. Help me please, tysm

upbeat otter
maiden fable
#

U can instead do client = bot and then do that thing

cloud dawn
#

!e ```py
import re

INVITE_RE = re.compile(
r"(discord([.,]|dot)gg|" # Could be discord.gg/
r"discord([.,]|dot)com(/|slash)invite|" # or discord.com/invite/
r"discordapp([.,]|dot)com(/|slash)invite|" # or discordapp.com/invite/
r"discord([.,]|dot)me|" # or discord.me
r"discord([.,]|dot)li|" # or discord.li
r"discord([.,]|dot)io|" # or discord.io.
r"((?<!\w)([.,]|dot))gg" # or .gg/
r")([/]|slash)" # / or 'slash'
r"(?P<invite>[a-zA-Z0-9-]+)", # the invite code itself
flags=re.IGNORECASE
)

test = 'some message haha discord.gg/python lol'
print(re.findall(INVITE_RE, test))

unkempt canyonBOT
#

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

[('discord.gg', '.', '', '', '', '', '', '', '', '', '', '/', 'python')]
proper acorn
#

Same file

maiden fable
shadow wraith
maiden fable
upbeat otter
proper acorn
cloud dawn
proper acorn
#

Right?

shadow wraith
shadow wraith
#

i wouldn't know how to explain it to you

velvet tinsel
cloud dawn
slate swan
slate swan
proper acorn
maiden fable
proper acorn
#

so how client work?

maiden fable
#

I meant, why not use an iterable

velvet tinsel
cloud dawn
velvet tinsel
#

You can call it Okimii itโ€™ll still work

shadow wraith
slate swan
proper acorn
slate swan
velvet tinsel
cloud dawn
shadow wraith
cloud dawn
velvet tinsel
#

Panda โ™ฅ๏ธ

cloud dawn
slate swan
#
import replit
import nextcord as disnake
bot = discord.Client()

@bot.event
def on_ready(message):
    await print("works')

Guys why doesnt this work

slate swan
velvet tinsel
#

Idk

#

Is there an error

slate swan
#

No๐Ÿ•ด๏ธ

#

" '

slate swan
#

doesn't seem right

velvet tinsel
#

Oh

slate swan
#

๐Ÿ˜ญ

velvet tinsel
#

Shit

upbeat otter
#

Mine was better

velvet tinsel
#

Why

slate swan
cloud dawn
slate swan
#

๐Ÿ•ด๏ธ

#

bot = discord.Client()
also seems like bs lemon_angrysad

upbeat otter
slate swan
velvet tinsel
#

I have a question

slate swan
#

y'all actually

slate swan
velvet tinsel
#

Why doesnโ€™t my code work

cloud dawn
upbeat otter
cloud dawn
slate swan
#

Guys i need help

velvet tinsel
#

No

upbeat otter
slate swan
#
print("run")

Why isn't my bot running๐Ÿ•ด๏ธ

slate swan
#

now my mind changed since u ded

maiden fable
#

what's even happening here

shadow wraith
unkempt canyonBOT
#

@shadow wraith :white_check_mark: Your eval job has completed with return code 0.

run
slate swan
#

we went ot in 10 seconds hunter

upbeat otter
cloud dawn
velvet tinsel
shadow wraith
#

๐Ÿ•ด๏ธ

velvet tinsel
#

๐Ÿคฌ

maiden fable
slate swan
#

Lollll

upbeat otter
velvet tinsel
slate swan
#

!ot ๐Ÿคฌ ๐Ÿ˜ค

unkempt canyonBOT
velvet tinsel
cloud dawn
upbeat otter
slate swan
shadow wraith
slate swan
#

get me outta here

cloud dawn
velvet tinsel
proven osprey
#

there are no problems, but when i join the voice channel it writes

maiden fable
#

member, before, after

#

!d discord.on_voice_state_update

unkempt canyonBOT
#

discord.on_voice_state_update(member, before, after)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") changes their [`VoiceState`](https://discordpy.readthedocs.io/en/master/api.html#discord.VoiceState "discord.VoiceState").

The following, but not limited to, examples illustrate when this event is called...
proven osprey
#

oh thank you! ill try

#

i wrote it but as you can see its grey, does it matter?

maiden fable
#

Actually it should be member, before, after

cloud dawn
maiden fable
#

That greyness just means that the variable hasn't been used anywhere

proven osprey
#

now it types another :(

maiden fable
#

Also the args means the member who joined/left the VC, his voice state before, his voice state after

#

!d discord.Member.display_name

unkempt canyonBOT
#

property display_name: str```
Returns the userโ€™s display name.

For regular users this is just their username, but if they have a guild specific nickname then that is returned instead.
maiden fable
proven osprey
#

understood

#

it works

#

thank you very much

maiden fable
#

(:

slate swan
#

how do I make a command which makes the bot not working in that channel like

user: !disable #channel_name
bot: stops giving outputs in the channel

maiden fable
#

Make a botvar with a list of channel IDs where not to send messages, add a bot check to check of ctx.channel.id is in the list, and return False if it is. Then, just append the channel ID to the list

proven osprey
#

when i am joining a definite voice channel bot must create voice channel and move me there, but he creates it only when i leave this definite channel

cloud dawn
#

!d discord.ext.commands.check

unkempt canyonBOT
#

@discord.ext.commands.check(predicate)```
A decorator that adds a check to the [`Command`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Command "discord.ext.commands.Command") or its subclasses. These checks could be accessed via [`Command.checks`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Command.checks "discord.ext.commands.Command.checks").

These checks should be predicates that take in a single parameter taking a [`Context`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Context "discord.ext.commands.Context"). If the check returns a `False`-like value then during invocation a [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure") exception is raised and sent to the [`on_command_error()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.discord.ext.commands.on_command_error "discord.discord.ext.commands.on_command_error") event.

If an exception should be thrown in the predicate then it should be a subclass of [`CommandError`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CommandError "discord.ext.commands.CommandError"). Any exception not subclassed from it will be propagated while those subclassed will be sent to [`on_command_error()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.discord.ext.commands.on_command_error "discord.discord.ext.commands.on_command_error").
cloud dawn
maiden fable
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...
proven osprey
velvet tinsel
#

;-;

slate swan
#

Never going to ot again

velvet tinsel
#

I am

crimson tendon
#

where is the permission to don't allow user to make a thread ?

slim whale
#

Hi, i'm making al logs, how i can know the time when the user left/joined the guild?

sage otter
unkempt canyonBOT
unkempt canyonBOT
#

discord.on_member_join(member)``````py

discord.on_member_remove(member)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") leaves or joins a [`Guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild "discord.Guild").

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

thanks!

#

but that doesnt tell me how to get the time when the user joined

sage otter
#

Idk about leaving

#

!d discord.Member.joined_at

unkempt canyonBOT
#

An aware datetime object that specifies the date and time in UTC that the member joined the guild. If the member left and rejoined the guild, this will be the latest date. In certain cases, this can be None.

sage otter
#

Exists tho

maiden fable
#

U can't tell when a person leaves

#

U can just do datetime.datetime.utcnow() in the on_member_remove event

slim whale
#

i will use that, thanks guys!

crimson tendon
sage otter
#

You have to have git

#

Youโ€™d do something like
pip install git+https://github.com/Rapptz/discord.py

slate nymph
#
class Cog2(commands.Cog):
    def __init__(self,bot):
        self.bot = bot
    @commands.Cog.listener()
    async def on_guild_join(self,guild:discord.Guild):
        for channels in guild.channels:
            global channel_list
            channel_list = await channels.create_webhook(name="Lemontree bot hook")

    @commands.command()
    async def sudo(self,ctx:commands.Context,member:discord.Member,*,message):
        hook = Union(channel_list)
        async with ClientSession() as session:
            await hook.send(content=message,avatar_url=member.display_avatar,username=member.display_name)```
#
    await ctx.command.invoke(ctx)
  File "C:\Users\sony\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\commands\commands.py", line 133, in invoke
    await injected(ctx)
  File "C:\Users\sony\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\commands\commands.py", line 90, in wrapped
    raise ApplicationCommandInvokeError(exc) from exc
discord.commands.errors.ApplicationCommandInvokeError: Application Command raised an exception: NameError: name 'channel_list' is not defined```
desert imp
#

I'm using discord.py rewrite and I have been having issues with running commands.

It isn't latency, I am getting an accurate response to my server, it just takes a while to register that I have sent the command.

When running on localhost I have next to 0ms, it just isn't searching for the command very quickly. Does anyone know why?

velvet tinsel
slate swan
#

Is there a way to make the bot respond with the help command when I only mention the bot? Like @|| || and nothing else?

quaint epoch
#

how do i create a role using ctx.guild.create_role(), how do i enter the name and set permissions like send_messages = False, manage_guild = False like that?

slate swan
quaint epoch
#

would it go like this? overwrites = discord.PermissionOverwrite() overwrites.send_messages = False overwrites.read_messages = True ctx.guild.create_role(name='name here', permissions=overwrites)

#

or not?

slate swan
quaint epoch
quaint epoch
#

does anyone know what are the default perms for a role?

tawdry perch
#

Is None valid for that?

quaint epoch
#

when i do py await member.add_roles(role)

#

do i have to do py await member.add_roles(roles=role)

haughty quartz
#

how can i check if something is a url

spring flax
west shuttle
#

Hi, i want to make a blog in google sites by just typing the command !blog <text>.
Is it possible?

quaint epoch
quaint epoch
#

bec i haven't ever used that

west shuttle
quaint epoch
west shuttle
quaint epoch
#

nice

haughty quartz
#

how do i find out who sent the message

slate swan
haughty quartz
slate swan
proven osprey
#

when i leave the voice channel it is deletes but the text channel is not

haughty quartz
#

because it says undefined name message

slate swan
haughty quartz
#
@bot.command()
async def submit(ctx, *, userinput):
    channel = bot.get_channel(895072295146651709)
    valid=validators.url(userinput)
    if valid==True:
      await channel.send(userinput+" submitted by "+ctx.author)
      await ctx.send("succesfully submitted!")
    else:
      await ctx.send("Please use a valid URL")```why do i get ```File "main.py", line 88, in submit
    await channel.send(userinput+" submitted by "+ctx.author)
TypeError: can only concatenate str (not "Member") to str```
#

@slate swan

slate swan
haughty quartz
slate swan
haughty quartz
#

okay

slate swan
#

Yep

slate swan
haughty quartz
#

ayy it worked :))

slate swan
#

Nicepithink

devout iris
#

how can i make my links like that?

slate swan
proven osprey
#

my bot creates a voice channel and text channel when an user joins into definite voice channel, then bot moves him to created voice channel, and if all users left this voice channel, it will be deleted also as a text channel. bot do all of this, but two times, and i dont now why. help me please!

haughty quartz
#

hey um @slate swan do you know how i can get the bot to get the image of a image sent into chat

devout iris
haughty quartz
#

because discord uploads images instantly to their servers

haughty quartz
#

yeah

#

if someone uploads a image to discord i want to get the discord url of it

#

any idea of how thats possible?

slate swan
#

Well im not really familiar with that unfortunately

devout iris
haughty quartz
#

sadge

devout iris
haughty quartz
#

thats weird

devout iris
#

smh what is wrong?

haughty quartz
#

maybe because its fat

#

but i dont think so

outer violet
#

How do I make a message send to every single channel

devout iris
#

alr i will try another thing

#

not working...

slate swan
# devout iris

Unfortunately it only works for a description of a embed as far as i know

slate swan
slate swan
devout iris
slate swan
devout iris
slate swan
# devout iris code

You sent the embed object you will need to use the embed kwarg to send the message as so:

em = discordEmbed(**kwargs)
await ctx.send(embed = em)
manic wing
#

!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**.
devout iris
#

ahh right

tawdry perch
#

nonce?

devout iris
#

tysm it is working now

slate swan
slim whale
#

Hello, im trying to make a voice logs, i have this code: ```py
@bot.event
async def on_voice_state_update(member_before, member_after):

Voice Logs

member_before.voice_channel
member_after.voice_channel
msg = ""
channel = bot.get_channel(913158722992373854)
if member_after.voice_channel == member_before.voice_channel:
return
if member_before.voice_channel == None:
msg = f"โ˜Ž [{datetime.utcnow().replace(microsecond=0)}] {member_after} ({member_after.id}) ha entrado al canal de voz: {member_after.voice_channel}"
else:
if member_after.voice_channel == None:
msg = f"โ˜Ž [{datetime.utcnow().replace(microsecond=0)}] {member_after} ({member_after.id}) ha abandonado el canal de voz: {member_before.voice_channel.mention}"
else:
msg = f"โ˜Ž [{datetime.utcnow().replace(microsecond=0)}] {member_after}({member_after.id}) se ha movido de canal de voz, de: {member_before.voice_channel.mention} a: {member_after.voice_channel.mention}"
await channel.send(msg)and this is the traceback Ignoring exception in on_voice_state_update
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
await coro(*args, **kwargs)```

manic wing
#

!d discord.on_voice_state_update || you sent the wrong part xD. it takes 3 args tho

unkempt canyonBOT
#

discord.on_voice_state_update(member, before, after)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") changes their [`VoiceState`](https://discordpy.readthedocs.io/en/master/api.html#discord.VoiceState "discord.VoiceState").

The following, but not limited to, examples illustrate when this event is called...
slim whale
#

oh yes

#

but thanks!

velvet tinsel
#

Caeden instantly gets the answer without having the full error

#

You are truly inspirational

slim whale
#

yes

manic wing
manic wing
manic wing
manic wing
slim whale
#

@manic wing now how i can get only the channel mention?

#

โ˜Ž [2021-12-14 20:50:29] CiCloH#2916(626127081419571206) se ha movido de canal de voz, de: <VoiceState self_mute=False self_deaf=False self_stream=False suppress=False requested_to_speak_at=None channel=<VoiceChannel id=913158723160121389 name='โ‚Šห˜เญจเญง๏ธฐ๐Ÿ’ธใƒปVIPS' rtc_region=None position=31 bitrate=64000 user_limit=0 category_id=913158723160121386>> a: <VoiceState self_mute=False self_deaf=False self_stream=False suppress=False requested_to_speak_at=None channel=<VoiceChannel id=913158723160121387 name='โ‚Šห˜เญจเญง๏ธฐ๐ŸฅžใƒปSala ยน' rtc_region=None position=29 bitrate=64000 user_limit=0 category_id=913158723160121386>>'

#

the bot sends this

manic wing
#

thats because you did {member_after} I believe

slim whale
#
@bot.event
async def on_voice_state_update(member, before, after):
  # Voice Logs
  name = member
  msg = ""
  channel = bot.get_channel(913158722992373854)
  if after == before:
    return
  if before == None:
    msg = f"โ˜Ž [{datetime.utcnow().replace(microsecond=0)}] **{name}** ({name.id}) ha entrado al canal de voz: {after}"
  else:
    if after == None:
      msg = f"โ˜Ž [{datetime.utcnow().replace(microsecond=0)}] **{name}** ({name.id}) ha abandonado el canal de voz: {before}"
    else:
      msg = f"โ˜Ž [{datetime.utcnow().replace(microsecond=0)}] **{name}**({name.id}) se ha movido de canal de voz, de: {before} a: {after}"
  await channel.send(msg)
manic wing
#

.mention returns a mention

#

yes, do you mean before.mention and after.mention?

slim whale
#

the code before was wrong

manic wing
#

!d discord.VoiceChannel.mention

unkempt canyonBOT
slim whale
manic wing
#

I can promise you that it doesn't

manic wing
slim whale
#

the discord.on_voice_state_update event sends everything its happening, if u unmute, mute if u change vc etc

manic wing
slim whale
#

@bot.event
async def on_voice_state_update(member, before, after):
  # Voice Logs
  name = member
  msg = ""
  channel = bot.get_channel(913158722992373854)
  if after == before:
    return
  if before == None:
    msg = f"โ˜Ž [{datetime.utcnow().replace(microsecond=0)}] **{name}** ({name.id}) ha entrado al canal de voz: {after.mention}"
  else:
    if after == None:
      msg = f"โ˜Ž [{datetime.utcnow().replace(microsecond=0)}] **{name}** ({name.id}) ha abandonado el canal de voz: {before.mention}"
    else:
      msg = f"โ˜Ž [{datetime.utcnow().replace(microsecond=0)}] **{name}**({name.id}) se ha movido de canal de voz, de: {before.mention}> a: {after.mention}"
  await channel.send(msg)```i have it like this
#
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "main.py", line 100, in on_voice_state_update
    msg = f"โ˜Ž [{datetime.utcnow().replace(microsecond=0)}] **{name}**({name.id}) se ha movido de canal de voz, de: {before.mention}> a: {after.mention}"
AttributeError: 'VoiceState' object has no attribute 'mention'```
#

@manic wing

manic wing
#

oh apologies, its actually after.channel.mention

slim whale
#

ohhh

#

thanks! โค๏ธ

manic wing
#

never worked with on_voice_state_update

slim whale
#

don't worry, thanks!

velvet tinsel
#

Caeden, what other languages do you know?

dry kelp
#

How can i check if the bot voice is already stopped?

#
    @commands.command(name='stop')
    @commands.has_permissions(manage_guild=True)
    async def _stop(self, ctx: commands.Context):

        if not ctx.author.voice or not ctx.author.voice.channel:
            em = discord.Embed(title=":err: Music Error!", description=f"You are not connected to a voice channel!", color=discord.Color.red())
            await ctx.send(embed=em)
            return

        if ctx.voice_client:
            if ctx.voice_client.channel != ctx.author.voice.channel:
                em = discord.Embed(title=":err: Music Error!", description=f"Scorpio is connected to another voice channel!", color=discord.Color.red())
                await ctx.send(embed=em)
                return

        if not ctx.voice_state.voice:
            em = discord.Embed(title=":err: Music Error!", description=f"Scorpio is not connected to a voice channel!", color=discord.Color.red())        
            await ctx.send(embed=em)
            return

        if not ctx.voice_state.is_playing:
            em = discord.Embed(title=":err: Music Error!", description=f"Nothing being played at the moment!", color=discord.Color.red())        
            await ctx.send(embed=em)
            return

        ctx.voice_state.songs.clear()
        if ctx.voice_state.is_playing:
            ctx.voice_state.voice.stop()
            em = discord.Embed(title=":Ver: Music Successful!", description='Scorpio has been stopped', color=discord.Color.from_rgb(black1, black2, black3))
            await ctx.send(embed=em)
#

code im using rn

manic wing
#

learning c++, scripted a bunch in bash - basic usage of html, css and js (enough to get around and make websites), bit of java

velvet tinsel
#

Sweet

slim whale
#

need more help XD, when i leave or join a vc the traceback is this

#
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "main.py", line 100, in on_voice_state_update
    msg = f"โ˜Ž [{datetime.utcnow().replace(microsecond=0)}] **{name}** ({name.id}) se ha movido de canal de voz, de: {before.channel.mention} a: {after.channel.mention}"
AttributeError: 'NoneType' object has no attribute 'mention'```
#
@bot.event
async def on_voice_state_update(member, before, after):
  # Voice Logs
  name = member
  msg = ""
  channel = bot.get_channel(913158722992373854)
  if after == before:
    return
  if before == None:
    msg = f"โ˜Ž [{datetime.utcnow().replace(microsecond=0)}] **{name}** ({name.id}) ha entrado al canal de voz: {after.channel.mention}"
  else:
    if after == None:
      msg = f"โ˜Ž [{datetime.utcnow().replace(microsecond=0)}] **{name}** ({name.id}) ha abandonado el canal de voz: {before.channel.mention}"
    else:
      msg = f"โ˜Ž [{datetime.utcnow().replace(microsecond=0)}] **{name}** ({name.id}) se ha movido de canal de voz, de: {before.channel.mention} a: {after.channel.mention}"
  await channel.send(msg)```
silver iris
final iron
#

!d discord.on_voice_state_update

unkempt canyonBOT
#

discord.on_voice_state_update(member, before, after)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") changes their [`VoiceState`](https://discordpy.readthedocs.io/en/master/api.html#discord.VoiceState "discord.VoiceState").

The following, but not limited to, examples illustrate when this event is called...
manic wing
slate swan
#
@client.before_invoke
async def before_invoke(ctx):
    if ctx.guild.id in [some ids]:
            invoke
        else:
            pass
``` how can i continue invoking the command?
manic wing
#

if the guild is blacklisted?

slate swan
#

nope, to run

slate swan
manic wing
#

so it will only run if its in some ids?

slate swan
#

yes

slim whale
#

so it sends that error

devout iris
#

i want to make a command when user use the command Messages coming to the channel where the command is used will come to a channel that I specify, and if I write a message to the channel where the message came from, my message will be sent to the channel where the command is used. how can i make it?

manic wing
unkempt canyonBOT
#

@discord.ext.commands.check(predicate)```
A decorator that adds a check to the [`Command`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Command "discord.ext.commands.Command") or its subclasses. These checks could be accessed via [`Command.checks`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Command.checks "discord.ext.commands.Command.checks").

These checks should be predicates that take in a single parameter taking a [`Context`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Context "discord.ext.commands.Context"). If the check returns a `False`-like value then during invocation a [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure") exception is raised and sent to the [`on_command_error()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.discord.ext.commands.on_command_error "discord.discord.ext.commands.on_command_error") event.

If an exception should be thrown in the predicate then it should be a subclass of [`CommandError`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CommandError "discord.ext.commands.CommandError"). Any exception not subclassed from it will be propagated while those subclassed will be sent to [`on_command_error()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.discord.ext.commands.on_command_error "discord.discord.ext.commands.on_command_error").
slate swan
#

@manic wing i wanna to check for every command

slate swan
#

not only for one

manic wing
#

its a global check for every command

slate swan
#

ah

slim whale
slate swan
#

ty

manic wing
slim whale
#

dm

manic wing
#

its not too complicated, my bot has it as a support thing - however, you need a couple things