#discord-bots

1 messages · Page 60 of 1

slate swan
#

Lol ok glad your doing well

vocal snow
#

yepp

junior verge
#

so it can grow in more than 100 servers?

slate swan
#

What’s wrong with him :(

primal token
#

what isnt

vocal snow
shrewd apex
#

this chat going crazy coz oki is missing

slate swan
primal token
#

can we change the topic now? over this nonsense?

shrewd apex
#

put up wanted posters lemon_clown

grim oar
#

He talks so much like him bro it gotta be him

slate swan
#

Doesn’t want his secret revealed

woeful tendon
#

now its saying my TOKEN is the error 😩

slate swan
slate swan
hollow lantern
#

How do I assign a variable to whatever this returns? await message.channel.fetch_message(message_id)

primal token
#

?!?

woeful tendon
# slate swan Send your code

import discord
import os
client = discord.Client(intents=discord.Intents.all())
@client.event
async def on_ready():
print(f"{client.user} logged in now!")

@client.event
async def on_message(message):
if message.content.startswith("$greet"):
await message.channel.send(f"Hello! How are you {message.author}")
elif "$thought" in message.content:
response = phrases[random.randint(0, len(phrases) - 1)]
await message.channel.send(response)

my_secret = os.environ['TOKEN]
client.run(my_secret)

woeful tendon
#

Wait where?

slate swan
#

Second to last line

#

You see it says ‘TOKEN and not ‘TOKEN’

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.

slate swan
#

Quick reminder that errors tell you the problem

woeful tendon
#

Ohh

dull terrace
silk fulcrum
dull terrace
#

7739monkathink last one is printing dir

woeful tendon
#

Alright lemme try it out

slate swan
vocal snow
#

have you ever made a dpy wrapper noid

primal token
#

yes? i have

swift pumice
#

!e
print('hi guys')

unkempt canyonBOT
#

@swift pumice :white_check_mark: Your 3.11 eval job has completed with return code 0.

hi guys
slate swan
primal token
#

i had a whole discussion about it lol

swift pumice
#

ok

dull terrace
vocal snow
shrewd apex
#

he meant he loves u that was google keyboard pithink

unkempt canyonBOT
#

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

hey elias!
shrewd apex
dull terrace
# dull terrace

so what would cause doing from config import * make it only import two of them

primal token
primal token
#

i deleted it a while ago, i think its src is on my computer tho

vocal snow
#

ohh are you on github

woeful tendon
primal token
dull terrace
vocal snow
#

just wanna see yout porjects !

shrewd apex
#

nope an all dunder to define what all is gonna be imported u are doing a wild card import

primal token
slate swan
primal token
#

zeffo is nervous hes been caughtducky_party

vocal snow
primal token
grim oar
#

I wanna follow you too!

#

So that I can get a followback.

primal token
#

ill rather delete my account than have both of you following me

vocal snow
#

ok i wont follow but whats ur account!

silk fulcrum
#

he has twitch?

primal token
shrewd apex
#

zeffo trying to investigate if noid is oki or not pithink

vocal snow
#

no no

silk fulcrum
#

oh u r talking about github right?

vocal snow
#

noid is not okimi. its impossible

shrewd apex
vocal snow
#

i want to see noids cool projects but he is shy 😩

silk fulcrum
primal token
#

i dont see any similarities between me and okimii lol

silk fulcrum
#

btw I updated the gist a little bit

grim oar
#

Yeah same 😫

silk fulcrum
#

@shrewd apex is this gud?

vocal snow
silk fulcrum
primal token
#

how do i give okimii vibes? hes charming while im dead inside and correct everyone?

woeful tendon
#

bro i keep getting errors time by time

slate swan
grim oar
#

far from charming bor

shrewd apex
silk fulcrum
shrewd apex
#

half the ppl sync in on_ready

primal token
#

anyways im going to stop shitposting

vocal snow
silk fulcrum
grim oar
#

Gotta satisfy some ego

slate swan
shrewd apex
vocal snow
#

can u send ur gh too harvs

primal token
grim oar
#

So rude

slate swan
vocal snow
slate swan
#

i deleted all my repos

primal token
#

eitherway github has a search feature so use it

woeful tendon
#

its like errors keep coming and coming: SyntaxError: invalid character in identifier

grim oar
slate swan
#

someone unstarred my fucking project

fickle hamlet
#

Maybe it's his significant other? Okimii had a zero two pfp while noid has a Hiro one? Maybe they were together.

slate swan
#

WHO DOES THAT

grim oar
#

that's saf

vocal snow
grim oar
primal token
grim oar
#

Tho I have never experienced it, I make my friends star them ok_handbutflipped

shrewd apex
#

huh i still see okimii tho?

shrewd apex
#

@slate swan

grim oar
#

I am your friend

slate swan
#

Only one of them has GitHub and I think they are dead

vocal snow
shrewd apex
#

thats 16/4/2022 💀

#

ic

grim oar
#

Lets be friens harvs.

sick birch
#

Folks I think we should get back on topic

primal token
#

.topic

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

Suggest more topics here!

slate swan
slate swan
primal token
#

bro

slate swan
#

It says like 5 directory’s down though

lone lichen
primal token
#

can we not talk about NSFW?

slate swan
grim oar
#

It automatically finds out all your kinks and recommend daily

lone lichen
#

Ohh sick

primal token
#

robin you made the topic worst

lone lichen
#

Ill upvote it

sick birch
silk fulcrum
#

noid gets annoyed about a topic for 10 minutes straight

fickle hamlet
#

Okimii behavior

primal token
#

.

lone lichen
#

@slate swan how much material does ur porn bot have 😂

primal token
#

You guys are extremely paranoid, its frightening at this point

slate swan
#

Over 500 thousand images and videos

lone lichen
vocal snow
primal token
#

ok

lone lichen
slate swan
slate swan
primal token
lone lichen
slate swan
vocal snow
lone lichen
grim oar
#

It's a phase

slate swan
#

@slate swan hey what’s your GitHub

primal token
slate swan
#

He deleted his GitHub

#

@primal token your are okkimi

whole sparrow
#

how do I send multiple pics in discord bot

lone lichen
slate swan
lone lichen
slate swan
#

It’s not a public bot

lone lichen
#

Make it

whole sparrow
#

you know how you can add multiple attachments if you were to send images as a user

#

how can I do that with a discord bot

slate swan
shrewd apex
#

files= kwarg in CTX.send

whole sparrow
#

Do i have to have multiple ctx.send(file=file) lines?

shrewd apex
#

a lost of files

whole sparrow
#

ah ok fair enough

shrewd apex
#

list of discord.File objects

whole sparrow
#

Thanks

#

Thats all I wanted to know

slate swan
#

Chat just died

silk fulcrum
#

And never came back

sick birch
#

Better dead than OT

tight obsidian
#

there's no need to constantly have a conversation in every channel

silk fulcrum
#

better ot than dead*

shrewd apex
#

Robin don't give negative vibes 🥲

sick birch
#

that’s the goal

silk fulcrum
#

yes, only give okimii or positive vibes

shrewd apex
#

💀

tight obsidian
vocal snow
#

:(

shrewd apex
#

if i had reaction perms i would react with 🔥

slate swan
#

I made merely a joke

silk fulcrum
slate swan
grim oar
#

Are you sure

slate swan
#

is there another way to edit the bot's description because when i try to get the number of guilds its in like this the client variable isnt defined yet

slate swan
silk fulcrum
#

client = Bot 😭

slate swan
slate swan
shrewd apex
#

u can use the activity

#

change presence for the bot every min or so in a task loop

slate swan
#

ah ok

slate swan
slate swan
unkempt canyonBOT
slate swan
#

Is this correct?

silk fulcrum
whole sparrow
silk fulcrum
#

client ewuals bot

sick birch
whole sparrow
#
        photo_list = [disnake.File(i) for i in file_location_list]
        print(photo_list)
        await channel.send(caption, file= photo_list)
silk fulcrum
#

ewuals :kekw:

whole sparrow
#

This is what I did

sick birch
slate swan
#

lmao just followed a tutorial

whole sparrow
#

ohhh

#

files

slate swan
#

can i change it to Client?

sick birch
shrewd apex
#

i think bot.description is read only not sure

sick birch
#

They’re terrible

whole sparrow
#

@sick birch u beautiful specimen thanks

silk fulcrum
#

beautiful specimen

shrewd apex
#

i totally didn't say the same thing pithink

slate swan
tight obsidian
slate swan
#

happy?

silk fulcrum
shrewd apex
#

u have all() why u need .members = True

primal token
sick birch
shrewd apex
sick birch
tight obsidian
#

yeah the lack of an official tutorial is sad

slate swan
#

just forgot to change it

shrewd apex
#

thats very important

primal token
sick birch
#

the documentation is dog

shrewd apex
#

ok guys gn i am gonna hit the bed 💤

silk fulcrum
#

fish*

silk fulcrum
primal token
#

im pretty sure they were going to rewrite the tutorials and starter or something like that

sick birch
#

they better

slate swan
primal token
#

!?

slate swan
primal token
#

?!?!?!?

vocal snow
primal token
slate swan
#

Should I code or play r6

silk fulcrum
#

make an API wrapper

primal token
#

me who uses cav: ducky_party

slate swan
slate swan
#

I use frost and blackbeard as my mains

tight obsidian
# primal token documentation<:ducky_party:639468753440210977>

There are different kinds of documentation. The purpose of a reference (what discord.py has, mostly) is to provide an accurate and complete description of the library. The purpose of a tutorial is to teach someone completely unaware of the library how to use it to solve concrete problems.
I found this quite helpful: https://diataxis.fr/

so the commands thing linked above is somewhere between reference and a how-to guide

slate swan
sick birch
#

Similar to discordjs and discordjs.guide

tight obsidian
#

@slate swan Please move the off-topic conversation to one of the off-topic channels. We already told you that.

slate swan
sick birch
#

I think discordpy is in need of discordpy.guide

primal token
slate swan
#

I’m gonna get banned again ffs

primal token
#

It provides tutorials but i wouldnt say theyre good either

sick birch
#

And this “reference” is only good for those already familiar with the library

tight obsidian
slate swan
silk fulcrum
sick birch
#

I think as a newbie jumping in, I’d be utterly lost just with the reference

primal token
tight obsidian
#

the quick start is quite limited 🙂

primal token
#

kek me neither

sick birch
#

I honestly don’t remember how I learned

#

It’s been quite a while

primal token
slate swan
#

I got banned because I spoke off topic in off topic

#

Mods need to make up their mind

silk fulcrum
slate swan
# silk fulcrum no u

Well at that moment I did make up my mind, to speak in off topic. And I’m making my mind up again, I would like to speak here.

primal token
#

!ot | todays your lucky day!

unkempt canyonBOT
slate swan
#

I don’t like the OT community very much

tight obsidian
#

hello

silk fulcrum
#

does donker know

slate swan
#

They were mean to meangry

silk fulcrum
#

hello

slate swan
#

hello starewaiting

tight obsidian
#

anyway... discord bots

primal token
#

someone is going to get muted for not listening to mods👀

grim oar
#

Konnichiwa fix-error san

slate swan
grim oar
#

Hello hello

silk fulcrum
#

jkjk

grim oar
#

it automatically gets passed

#

Jkjk

void flax
#

what's up with pycord vs discordpy

primal token
silk fulcrum
sick birch
grim oar
#

yes I 100% am sure

primal token
#

how can you compare the 2 if pycord is based of dpy kek

grim oar
#

Because they are 2 different entities

void flax
#

because they are both libraries for writing discord bots

silk fulcrum
slate swan
#

Damn opposition is so bad, they were just hanging out at an open door

#

Are sets new or smth cause I see more people using them spongey_sad

vocal snow
#

No

sick birch
#

They’re a fundamental data structure

primal token
#

which is a fork? only real difference is implementation after dpys death, the only thing you can compare is its types, but thats unequal, get the joke? unequal types.....

grim oar
#

No

primal token
#

bro

vocal snow
#

I didn't get the joke either

grim oar
#

Bro??? Okmi??

primal token
#

smh

vocal snow
#

This some okmi level hunor

#

do better

primal token
#

my humor is horrible how is it equal to him?!??

torn sail
#

isnt the documentation for min_values in select menus inaccurate because select menus can have a min_values of 0

min_values (int) – The minimum number of items that must be chosen for this select menu. Defaults to 1 and must be between 1 and 25.

slate swan
grim oar
#

That's written in docs bro

torn sail
#

idk how to use shift .

primal token
#

imaging having 2 shifts and not knowing how to use neither one of them kek

torn sail
#

yep discord.py says min value can be lowest of 1 but discord docs say it can be of 0

slate swan
#

can someone tell me as to why the second status in the cycle doesnt work

tight obsidian
#

You create a new cycle on every call to status_change

#

it's analogous to:

def f():
    x = 0
    print(x)
    x += 1
grim oar
#

on_ready calls once only

tight obsidian
#

but status_change will be called repeatedly

grim oar
#

Ah yes am dum

hollow osprey
#

you could make the cycle an instance attribute

slate swan
#

ye it does change

hollow osprey
#

and use that

slate swan
#

its not that

#

i think its something to do with sef.bot.guilds

#

because it changes normally

tight obsidian
slate swan
#

well when i run the bot

#

and use just two strings without an f string

hollow osprey
#

or just iterate over the cycle and asyncio.sleep between iterations. idk if that's preferable over tasks.loop

silk fulcrum
#

why would you need a cycle there?

slate swan
#

it works fine

#

but when i add that f string with the amount of servers it doesnt

slate swan
primal token
silk fulcrum
grim oar
#

What

silk fulcrum
#

.guilds will change automatically

slate swan
#

can u not see

silk fulcrum
#

no need for cycle

slate swan
#

look closely theres a comma

primal token
slate swan
#

it doesnt need to

#

on_ready is when the bot turns on

#

goes online*

primal token
#

no?

grim oar
#

The library calls it inside bruh..

primal token
#

!d discord.on_connect

unkempt canyonBOT
#

discord.on_connect()```
Called when the client has successfully connected to Discord. This is not the same as the client being fully prepared, see [`on_ready()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.on_ready "discord.on_ready") for that.

The warnings on [`on_ready()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.on_ready "discord.on_ready") also apply.
primal token
#

this is the event that gets called when a connection has been established

slate swan
#

Should I have ice cream or biscuit (or cookie for the foul people)

primal token
slate swan
#

!d discord.on_ready

unkempt canyonBOT
#

discord.on_ready()```
Called when the client is done preparing the data received from Discord. Usually after login is successful and the [`Client.guilds`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Client.guilds "discord.Client.guilds") and co. are filled up.

Warning

This function is not guaranteed to be the first event called. Likewise, this function is **not** guaranteed to only be called once. This library implements reconnection logic and thus will end up calling this event whenever a RESUME request fails.
slate swan
primal token
#

they're average

slate swan
#

There like 1kb

grim oar
#

Seasoned with fine grains of data theft

primal token
#

🤤

slate swan
#

I want real food 😭

#

So ice cream or cookie

primal token
#

what isnt real about an HTTP cookie?

silk fulcrum
slate swan
slate swan
primal token
#

why?

slate swan
primal token
#

ok

grim oar
#

It would have data thiefs

#

Thieves

slate swan
#

I like eating men

primal token
#

⁉️

slate swan
#

Has there ever been a female hacker

#

Like now that I think about it

primal token
#

!??!?????

slate swan
#

There hasn’t been any major female hacker

grim oar
#

Andrew Tate of the pydis

slate swan
#

I’m not saying like oh women are bad they can’t hCk

primal token
#

watch him get banned

slate swan
#

I’m just saying that there is a lack of women hackers

#

We need more women hackers

grim oar
#

Off topic

slate swan
primal token
daring olive
#

any users that post any further messages not about discord bots will be moderated

silk fulcrum
#

😳

slate swan
daring olive
#

with previous history taken into account

slate swan
hollow osprey
silk fulcrum
# slate swan like this?

no, you're still defining it inside the function, still py def foo(): n = 0 do_something() n += 1

hollow osprey
#

like self.statuses = cycle(...)

#

in __init__

slate swan
#

oh

hollow osprey
#

then in status_change, use that

slate swan
#

When will bots be able to screen share spongey_sad

slate swan
silk fulcrum
#

fnr

slate swan
#

I’m wanna make cloud gaming on discord

primal token
swift pumice
#

is there a way to do this easier?

slate swan
silk fulcrum
#

and lists to have some certain strings and data in them...

swift pumice
silk fulcrum
primal token
primal token
#

markdown

primal token
#

an md file should be used as embeds use md formats

#

e.g @unkempt canyon uses md files for tags

silk fulcrum
#

never heard of that

#

!embedsmd

primal token
silk fulcrum
#

!mdembeds

silk fulcrum
hollow osprey
#

!src tags

unkempt canyonBOT
#
Command: tags

Show all known tags, a single tag, or run a subcommand.

Source Code
silk fulcrum
#

I'm making a gist with md file bruh

primal token
silk fulcrum
#

!tag dashmpip

unkempt canyonBOT
#
Install packages with `python -m pip`

When trying to install a package via pip, it's recommended to invoke pip as a module: python -m pip install your_package.

Why would we use python -m pip instead of pip?
Invoking pip as a module ensures you know which pip you're using. This is helpful if you have multiple Python versions. You always know which Python version you're installing packages to.

Note
The exact python command you invoke can vary. It may be python3 or py, ensure it's correct for your system.

silk fulcrum
#

actually?

silk fulcrum
primal token
pliant gulch
#

ooh a fun project would be to make a meta language to design discord embeds

#

Should be easy enough

#

Or application commands

primal token
#

theres already embed builders but most of them dont even work kek

grim oar
#

html extension for embeds

pliant gulch
junior verge
#

Shouldn't be too hard

pliant gulch
#

I've already done a simple programming lang

#

Shouldn't be to hard

primal token
pliant gulch
#

A builder uses methods right?

primal token
#

and a meta language can use statements?

pliant gulch
#

A meta language would be like writing in english to describe it

primal token
hollow osprey
#

a DSL

pliant gulch
#

Yea

hollow osprey
#

Domain Specific Lang

#

never wrote one in Python though

pliant gulch
#

It's super easy with lark

hollow osprey
#

I see

pliant gulch
#

Mostly cause of the EBNF

grim oar
#

assemblies are dsl too right!!

slate swan
#

I’m mowing down these French fries crisps

junior verge
#

Hey Daxles,

Thanks so much for your verification and Presence intent requests! Everything is looking good so far. We had some additional questions to continue with the process:

  1. Can you provide some screenshots of your bot in operation within a Discord server? We'd like to know more about what your bot actually does.

  2. The command ".remove" seems to be a great way for users to get their data deleted at any time they choose but we have to make sure that the data is not stored forever. We recommend that the information is stored for 30 days or less. Can you configure this expiry cliff for your bot prior to verification? Perhaps it can be configured so the data is deleted automatically after 30 days of the user not enacting any commands or after the user leaves the server? This is required in case the users never enact the ".remove" command.

  3. Finally, share code snippets from your most used commands.

We need the information above and that expiry cliff to be configured in order to continue with this process.

Thanks in advance!
Erick G

This good right?

slate swan
junior verge
#

wtf?

slate swan
#

Nvm I’m getting banned like rn

daring olive
#

!ban 953394680073179207 consistently testing the server rules and moderation limits

unkempt canyonBOT
#

:incoming_envelope: :ok_hand: applied ban to @white raft permanently.

rancid raptor
#

The task i need to run doesn't work

"Core command group (commands ex. info, help)"
import logging
import discord
from discord.ext import commands, tasks
from api import bots_gg

class HelpCommand(commands.MinimalHelpCommand):
    "Help Command for this bot, might add some custom methods."


class Utility(commands.Cog):
    "Basic functionalities of the bot, like information."

    def __init__(self, client: commands.Bot) -> None:
        self.client = client
        client.help_command = HelpCommand()
        client.help_command.cog = self
    
    @commands.Cog.listener()
    async def on_ready(self) -> None:
        self.update_bot_statistics.start()

    async def cog_unload(self) -> None:
        self.update_bot_statistics.cancel()

    @tasks.loop(seconds=5)
    async def update_bot_statistics(self):
        "Updates statistics about the bot."
        print("update")
        if self.client.application_id:
            bots_gg.update_statistics(self.client.application_id, self.client.guilds.count())

I get that error

Task exception was never retrieved
future: <Task finished name='Task-12' coro=<Loop._loop() done, defined at /home/vscode/.local/lib/python3.8/site-packages/discord/ext/tasks/__init__.py:200> exception=TypeError("update_bot_statistics() missing 1 required positional argument: 'value'")>
Traceback (most recent call last):
  File "/home/vscode/.local/lib/python3.8/site-packages/discord/ext/tasks/__init__.py", line 264, in _loop
    raise exc
  File "/home/vscode/.local/lib/python3.8/site-packages/discord/ext/tasks/__init__.py", line 239, in _loop
    await self.coro(*args, **kwargs)
TypeError: update_bot_statistics() missing 1 required positional argument: 'value'
tawdry tendon
#

hello

#

need help with this

#
@bot.command()
async def snipemsg(ctx, message):
    msg = str(message.author)+ ' deleted message in '+str(message.channel)+': '+str(message.content)
    await ctx.send(msg)```
#

but then i get this error

#
discord.ext.commands.errors.MissingRequiredArgument: message is a required argument that is missing.```
#

anyone know why?, i get the error after typing in the command btw

primal fox
#

can you show the command you're typing?

tawdry tendon
#

.snipemsg

#

thats the one im using

primal fox
#

so what message is your code referring to?

tawdry tendon
#

wym

primal fox
#

you call message.author

smoky cedar
primal fox
#

What message?

tawdry tendon
smoky cedar
tawdry tendon
primal fox
#

I'm trying to help him understand

smoky cedar
#

Ah. Did you follow .snipemsg with a message @tawdry tendon ?

tawdry tendon
#

no

smoky cedar
#

Exactly. Message is missing.

tawdry tendon
#

oh

#

but im only using message to use message.author and stuff

primal fox
#

your code looks for a message that you give it

#

Is my point

tawdry tendon
primal fox
#

so you want the message associated with the command?

smoky cedar
tawdry tendon
#

oh

#

so i can do ctx.author?

primal fox
#

try it

smoky cedar
#

To get details about the original message that initiated the command

tawdry tendon
#

ok

primal fox
#

I'm not clear what you're trying to do tbh

#

But ctx is probably correct

smoky cedar
#

I'm guessing they're just trying to play around with the library

#

Also, I suggest using slash commands, prefix commands are a bit outdated now

tawdry tendon
#

oh...

#

whats the differenve

#

difference

#

and btw i got a new error

mossy jacinth
#

how can i find if the member is the bot owner?

smoky cedar
# tawdry tendon whats the differenve

Typing slash brings up a menu of the bots in the server and the commands, they're actually meant to be sent as commands and offer a lot more, versus a prefix command is just a message that the bot parses and realizes is meant for them

tawdry tendon
#

oh

#

ok

rancid raptor
tawdry tendon
#

I want to ask a question that no one wants to help me on

smoky cedar
tawdry tendon
#

i want to do this:
so say i type in a commands like:
!setrolepurge "whateverrolehere"

#

and then take the users argument from the command which would be "whateverrolehere"

#

and use that so only the role specified can use the "purge" command

#

is that possible and how?

smoky cedar
# tawdry tendon and use that so only the role specified can use the "purge" command

You'd need a database, and you'd need the guild id in the database, and then in that command you'd have to set a value in the guilds table that probably indicates the role id of the role allowed to purge.

Whenever purge is called, you'd query the role from the db for that guild and check that the user has it.

However, this is a bit redundant today if you ask me. With slash commands, server owners can use Manage Integrations and limit the roles that can use each command themselves

glad cradle
#

if anyone knows

Hi, I'm trying to implement watchfiles in disnake, but there's a problem, bot.run('') starts a loop the problem is that watchfiles too uses a loop to listen and catch files events, should I run the loop of watchfiles in another thread with asyncio.run_coroutine_threadsafe?

tawdry tendon
#

i learnt some sql already

pliant gulch
#

You could just do loop.create_task(entry()

smoky cedar
# tawdry tendon can you go through the sql one with me

You'd need a table - guild_id being the main key, purge_role_id, the id of the role that can use the purge command. For testing you can just use python's sqlite3 library since it's local. In setrolepurge, you'd check if the guild is already in the db, if so, you'd query to update the purge_role_id column for that guild. If not, you'll add the guild with the purge_role_id.

Then, when you call purge, you'll check the guilds table and get the purge_role_id for the table that matches guild_id. Then you'll check if the user that called the purge command has that role.

smoky cedar
#

But like I said -> using slash commands is better since it lets server owners set command permissions themselves

tawdry tendon
#

thanks

crystal glen
#

Any Idea why my command is not working?

smoky cedar
# tawdry tendon is it easier?

Slash commands? It's pretty much about the same - might be a bit harder to learn since it's newer and the documentation is more scarce, but the code isn't really more complicated

glad cradle
tawdry tendon
#

oh then id rather use sql than learn about slash commands today

silk fulcrum
#

what is sql

pliant gulch
tawdry tendon
smoky cedar
#

Remember that you'd probably need to limit the role that can set the purge role to admin @tawdry tendon

smoky cedar
# tawdry tendon wdym

What would be the point in letting someone set the role that can purge if anyone can change it

tawdry tendon
#

no not anyone

smoky cedar
#

You'd prolly want only an admin to be able to change / configure it right

small crag
#

i have a question

tawdry tendon
#

true

silk fulcrum
unkempt canyonBOT
#

Hey @small crag!

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

tawdry tendon
#

i will just do the@has_permission (administrator=True)

silk fulcrum
#

has_permissions*

tawdry tendon
#

because before i wanted them to pick what role can use it

tawdry tendon
primal fox
small crag
small crag
#

yes

silk fulcrum
#

replit is sharing an IP for every bot

mossy jacinth
silk fulcrum
#

if one gets ratelimited everyone get ratelimited

tawdry tendon
#

only reason im using replit is for 24/7

tawdry tendon
#

just if you didnt know

primal token
glad cradle
primal token
silk fulcrum
primal token
#

not documented tho

silk fulcrum
#

you are checking if member.id == "..."

#

id is int

tawdry tendon
#

i only use replit fo r24/7

silk fulcrum
#

remove quotes

primal token
silk fulcrum
tawdry tendon
#

🤣

rancid raptor
glad cradle
primal fox
primal token
silk fulcrum
#

botcore

#

!src botcore

unkempt canyonBOT
#
Bad argument

Unable to convert 'botcore' to valid command, tag, or Cog.

quaint epoch
#

!src core

unkempt canyonBOT
#
Bad argument

Unable to convert 'core' to valid command, tag, or Cog.

quaint epoch
#

!src bot_core

unkempt canyonBOT
#
Bad argument

Unable to convert 'bot_core' to valid command, tag, or Cog.

silk fulcrum
#

yeah very bad argument

quaint epoch
#

bad bot

primal token
#

#bot-commands

silk fulcrum
#

!src bot-core

unkempt canyonBOT
#
Bad argument

Unable to convert 'bot-core' to valid command, tag, or Cog.

glad cradle
unkempt canyonBOT
#

disnake/ext/commands/bot_base.py line 142

class BotBase(CommonBotBase, GroupMixin):```
primal token
silk fulcrum
unkempt canyonBOT
#

disnake/ext/commands/bot_base.py lines 142 to 152

class BotBase(CommonBotBase, GroupMixin):
    def __init__(
        self,
        command_prefix: Optional[
            Union[PrefixType, Callable[[Self, Message], MaybeCoro[PrefixType]]]
        ] = None,
        help_command: HelpCommand = _default,
        description: str = None,
        **options: Any,
    ):
        super().__init__(**options)```
silk fulcrum
#

bruh Rapptz

#

habit

unkempt canyonBOT
#

disnake/ext/commands/common_bot_base.py line 96

loop = asyncio.get_event_loop()```
glad cradle
#

he can't set loop with super

primal token
glad cradle
#

😭

primal token
#

but since it uses get_event_loop cant you use the event loop watchfiles or whatever the lib is called?

glad cradle
#

Well I'll explain the problem

pliant gulch
#

By default internally get_event_loop is called

#

So that means, as long as you HAVE running loop from watchfiles it'll automatically use it

#

Just make sure you run the watchfiles before starting the bot and it'll share the loop

glad cradle
#

that's the 2 last line of my main.py

async def main():
    async for changes in awatch('./'):
        print(changes) #just for test

asyncio.run(main())
bot.run(token)

if i do like this the Bot won't start coz it's blocked by the watchfiles event loop, vice versa bot.run is a blocking call so everything under it doesn't execute

pliant gulch
primal token
#

using asyncio.create_task smart

pliant gulch
#

Bot.run doesn't create a new loop though

primal token
pliant gulch
#

Bot.run uses loop attr set during construction

#

If a loop kwarg is passed to the constructor it'll use that as the value for self.loop

#

And if there is NONE passed by default it gets the CURRENT running loop

#

So as long as you have a loop running before hand, it'll be shared with the class

primal token
#

yeah it was

self.loop = loop or asyncio.get_event_loop()
pliant gulch
#

But in "our" case this is never the case

#

Including the fact that asyncio.run just creates one as well

sick birch
#

Starting the script or the bot?

primal token
silk fulcrum
#

new_event_loop?

primal token
#

the only way the loop were created is with the usage of Bot.run that iirc makes a loop if its None

sick birch
#

bot should go online once you run the script

pliant gulch
#
asyncio.run(bot.start(...))
``` lets use this as an example, okay
#

asyncio.run -> creates a new event loop and runs the coroutine

#

In bot.start it'll have a running loop

primal token
#

i ment using Bot.run sorry

pliant gulch
#

Bot.run is the same thing

#

It uses bot.loop

primal token
#

but doesn't it use something like

loop = self.loop or asyncio.new_event_loop()

?

pliant gulch
#

No

primal token
#

kekducky_party

pliant gulch
#
self.loop: asyncio.AbstractEventLoop = asyncio.get_event_loop() if loop is None else loop
sick birch
primal token
#

yeah fuck, i was confusing my abstractions with dpys

pliant gulch
#

get_event_loop can CREATE new event loop when None is being ran

#

Discord.py does it a bit different in the fact that the client first starts off with a sentinel value

#

Other than that it just sets the loop when actually being ran

#

Sort of like a "lazy" method if you understand that terminology

#

So for discord.py it's basically the same thing, if you have a running loop before running the bot

#

It'll share the loop

junior verge
#

@sick birch They responded after 15m already it was actually crazy

tawdry tendon
#

hello

#

im using replit with databases

silk fulcrum
#

hello

#

sad

tawdry tendon
#

how can i open the database

tawdry tendon
silk fulcrum
tawdry tendon
#

but u have to open it with a file

#

how do i get the file from my computer?

silk fulcrum
#

shouldnt there be some function like "Load file"?

tawdry tendon
#

for sqlite?

tawdry tendon
#

im using DB Browser

#

so i have to open it from there

pliant gulch
slate swan
#

Is it possible to make the command work when the button is pressed ?

sick mulch
#

Traceback (most recent call last):
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in <module>
start(fakepyfile,mainpyfile)
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 30, in start
exec(open(mainpyfile).read(), main.dict)
File "<string>", line 13, in <module>
TypeError: init() missing 1 required keyword-only argument: 'intents'

[Program finished]

#

How to fix

slate swan
#

@sick birch Can I ask you a question ?

silk fulcrum
#

Questionable

slate swan
#

@silk fulcrum
Is it possible to make the command work when the button is pressed ?

silk fulcrum
#

it doesn't work?

slate swan
silk fulcrum
#

to give it from the View to the command code you can set view.value inside of the view to your text

#

and in command do await view.wait()

#

and then use view.value there

small crag
#

question:
i have a command, >echo that is supposed to repeat the text in an embed
the thing is, it simply doesn't work
no error shows in the output, literally nothing happens

import discord
from discord.ext import commands
intents = discord.Intents.default() 

intents.members = True 

client = commands.Bot(command_prefix=['>'], intents = intents)



@client.command()
async def echo(ctx, *, message,):

    name = str(ctx.message.author.name)

    embed=discord.Embed(title=name + "'s echoed message", description=f'*{message}* ', color=0x0095ff)
    
    await ctx.message.delete()
    await ctx.send(embed=embed)
   





client.run('token')

slate swan
#

@silk fulcrumroughly understood. Thanks I'm going to do

wicked atlas
small crag
#

ok

small crag
# wicked atlas Try enabling message intents ```py intents.message_content = True ```

giving me another error

Traceback (most recent call last):
File "main.py", line 27, in <module>
client.run('tokenI')
File "/home/runner/adirondack-bot/venv/lib/python3.8/site-packages/discord/client.py", line 828, in run
asyncio.run(runner())
File "/nix/store/2vm88xw7513h9pyjyafw32cps51b0ia1-python3-3.8.12/lib/python3.8/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/nix/store/2vm88xw7513h9pyjyafw32cps51b0ia1-python3-3.8.12/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/home/runner/adirondack-bot/venv/lib/python3.8/site-packages/discord/client.py", line 817, in runner
await self.start(token, reconnect=reconnect)
File "/home/runner/adirondack-bot/venv/lib/python3.8/site-packages/discord/client.py", line 746, in start
await self.connect(reconnect=reconnect)
File "/home/runner/adirondack-bot/venv/lib/python3.8/site-packages/discord/client.py", line 672, in connect
raise PrivilegedIntentsRequired(exc.shard_id) from None
discord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead.

Discord Developer Portal

Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.

small crag
silk fulcrum
#

burh

silk fulcrum
#

hm... could be

slate swan
quaint epoch
#

im convinced 100% of people that go here are bots that generate random text that's python code, run it and post an image of the terminal

quaint epoch
sick birch
#

looks like so

silk fulcrum
slate swan
#

@sick birch it looks cool. But it's too complicated for me

#

@sick birch and which module is used for this ?

unkempt canyonBOT
slate swan
sick birch
tawdry tendon
#

hello

#

i have this

#
@has_permissions(manage_messages=True)
async def purge(ctx, amount=1):
    if message.author.guild_permissions.manage_messages:
        await ctx.channel.purge(limit=amount + 1)
        await ctx.send(f"{amount} messages have been purged!")
    else:
        ctx.send("Nice try, you need manage messages permissions to do this")``` but when i try to use .purge command it just doesnt work and has this error ```[2022-08-26 22:34:28] [ERROR   ] discord.ext.commands.bot: Ignoring exception in command None
discord.ext.commands.errors.CommandNotFound: Command "purge" is not found```
wicked atlas
faint sapphire
#

hi,
hosting my discord bot in vs code works
but on heroku it doesnt anymore, i also tried hosting it on my raspberry pi (i did the pip install discord, and added
"intents=discord.Intents.default()" inside of client = discord())
and it doesnt work either
any ideas?

tawdry tendon
#

BRO

#

IM AN IDIOT

wicked atlas
#

lol

wicked atlas
faint sapphire
#

so i dont get any errors

#

wether its on my rpi or heroku

wicked atlas
#

What errors?

faint sapphire
#

and the bot works when i run it with vs code

#

there arent any

wicked atlas
#

Then what isn't working?

faint sapphire
#

the bot doesnt go online

#

it only does when i run in vs code

#

same script

#

im prob missing something for it to work on heroku/raspberry pi

wicked atlas
#

Do all of your scripts have the same token in them, and are you sure that they are running successfully?

faint sapphire
#

i can show u the build log in heroku

unkempt canyonBOT
#

Hey @faint sapphire!

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

#

Hey @faint sapphire!

It looks like you tried to attach file type(s) that we do not allow (.html). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a, .csv, .json.

Feel free to ask in #community-meta if you think this is a mistake.

quaint epoch
#

smh

tawdry tendon
#

hello

#

another question

faint sapphire
quaint epoch
tawdry tendon
#

im about to senf

#

wait

#
@bot.command()
@has_permissions(manage_messages=True)
async def purge(ctx, amount=1):
    if message.author.guild_permissions.manage_messages:
        await ctx.channel.purge(limit=amount + 1)
        await ctx.send(f"{amount} messages have been purged!")
    else:
        ctx.send("Nice try, you need manage messages permissions to do this")
``` with this error ```[2022-08-26 22:38:30] [ERROR   ] discord.ext.commands.bot: Ignoring exception in command purge
Traceback (most recent call last):
  File "C:\Users\Ayman\PycharmProjects\pythonProject1\venv\lib\site-packages\discord\ext\commands\core.py", line 190, in wrapped
    ret = await coro(*args, **kwargs)
  File "C:\Users\Ayman\PycharmProjects\help\main.py", line 220, in purge
    if message.author.guild_permissions.manage_messages:
AttributeError: 'str' object has no attribute 'author'

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

Traceback (most recent call last):
  File "C:\Users\Ayman\PycharmProjects\pythonProject1\venv\lib\site-packages\discord\ext\commands\bot.py", line 1347, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\Ayman\PycharmProjects\pythonProject1\venv\lib\site-packages\discord\ext\commands\core.py", line 986, in invoke
    await injected(*ctx.args, **ctx.kwargs)  # type: ignore
  File "C:\Users\Ayman\PycharmProjects\pythonProject1\venv\lib\site-packages\discord\ext\commands\core.py", line 199, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'str' object has no attribute 'author'```
junior verge
#

My bot got verified in less then 3h

wicked atlas
tawdry tendon
#

something else LOL

#
@bot.command()
@has_permissions(manage_messages=True)
async def purge(ctx, amount=1):
    if ctx.author.guild_permissions.manage_messages:
        await ctx.channel.purge(limit=amount + 1)
        await ctx.send(f"{amount} messages have been purged!")
    else:

        await ctx.send("Nice try, you need manage messages permissions to do this")```
#

i have this i did if they have the permission they can use it else they cant

#

is this how its formatted?

tawdry tendon
junior verge
#

Thanks

tawdry tendon
#

can i check it out

tawdry tendon
#

@wicked atlas can you herlp?

#

it works

#

but it doesnt say the last line

junior verge
wicked atlas
tawdry tendon
#

i have this code

#

oh

#

so if i remove has_permissions it will work>

#

because i have if ctx.author.guild_permissions.manage_messages:

wicked atlas
#

Yes, that would work

tawdry tendon
#

ok

#

thanks again

tawdry tendon
#

but i need help.... again

#
async def on_ready():
    print(f'Connected : {bot.user.name}')
    db = sqlite3.connect('main.sqlite')
    cursor = db.cursor()
    cursor.execute('''
        CREATE TABLE IF NOT EXISTS main(
        guild_id TEXT,
        msg TEXT,
        role_id TEXT
        )
        ''')

@commands.group(invoke_without_command=True)
async def welcome(self, ctx):
    await ctx.send('Available setup commands: \nWelcome Channel <#channel>\nwelcome text <message>')

@welcome.command()
async def channel(self, ctx, channel:discord.TextChannel):
    if ctx.message.author.guild_permissions.manage_messages:
        db = sqlite3.connect('main.sqlite')
        cursor = db.cursor()
        cursor.execute(f'SELECT channel_id FROM main WHERE guild_id = {ctx.guild.id}')
        result = cursor.fetchone()
        if result is None:
            sql = ("INSERT INTO main(guild_id, channel_id) VALUES(?, ?)")
            val = (ctx.guild.id, channel.id)
            await ctx.send(f"Channel has been set to {channel.mention}")
        elif result != None:
            sql = ("UPDATE main SET channel_id = ? WHERE guild_id = ?")
            val = (channel.id, ctx.guild.id)
            await ctx.send(f"Channel has been updated to {channel.mention}")
        cursor.execute(sql, val)
        db.commit()
        cursor.close()
        db.close()
#

it just doesnt work

#

lemme see if there is an error

#

yes

#
discord.ext.commands.errors.CommandNotFound: Command "welcome" is not found```
#

why is this?

wicked atlas
#

I don’t use groups much

tawdry tendon
#

ah

#

oh no

#

its commands.group

#

well thanks for helping me a lot

junior verge
#

!paste

tawdry tendon
#

please

#

help

tawdry tendon
#

i opened a help channel

tawdry tendon
#

https://paste.pythondiscord.com/alijimoyid
and i got this error [2022-08-26 23:41:04] [ERROR ] discord.ext.commands.bot: Ignoring exception in command None discord.ext.commands.errors.CommandNotFound: Command "command" is not found

wicked atlas
#

you sure you're reading these errors?

tawdry tendon
#

Sorry wrong error

hasty jay
#

Hi, how do you run 2 bot token with the same cog?
Im trying to clone my bot with another bot

tawdry tendon
#

It’s supposed to say .welcome

wicked atlas
#

check again

tawdry tendon
#

😭😭😭😭🤣🤣🤣

hasty jay
#

Hi what?

tawdry tendon
#

Nothing nothing

wicked atlas
#

They thought this was a help channel

wicked atlas
silk fulcrum
#

1

111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111

wicked atlas
faint sapphire
#

hi
ive got a bot that goes online when i host it on a raspberry pi
but it doesnt respond
it works when i run it in vs code tho
the bot doesnt use commands but reads messages' content

i had gotten an intents error and changed it to this to avoid it
client = discord.Client(intents=discord.Intents.default())

if anyone got experience doing this with the RPi, holla at me

drifting arrow
#

How do I send traceback to a channel?

sick birch
drifting arrow
#

I figured out a basic way I guess

zealous jay
#

Uuh, how do I make an error handler in d.py 2.0?

zealous jay
#

btw I figured it out, for discord.py 2.0 it works diffferent

torn sail
#

Oh ok

zealous jay
#

its for a specific command tho

torn sail
#

I see

zealous jay
#

but you can add several decorators

#

@command_1.error
@command2_.error

torn sail
#

Do you need the cog listener decorator?

zealous jay
#

uuh

#

to be honest I forgot to delete it, probably not

#

let me test

torn sail
#

Yeah you don’t need it probably

#

Also make sure to raise the exception if it’s not handled if not doing so already

zealous jay
#

nope, you don't need it (the listener decorator)

torn sail
#
else:
    raise error
slate swan
#

🦫

slate swan
zealous jay
#

yes

#

it did

slate swan
#

hm

#

!d discord.app_commands.Command.error

unkempt canyonBOT
#

@error(coro)```
A decorator that registers a coroutine as a local error handler.

The local error handler is called whenever an exception is raised in the body of the command or during handling of the command. The error handler must take 2 parameters, the interaction and the error.

The error passed will be derived from [`AppCommandError`](https://discordpy.readthedocs.io/en/latest/interactions/api.html#discord.app_commands.AppCommandError "discord.app_commands.AppCommandError").
slate swan
slate swan
#

Just get to work

#

?

#

Don't talk to me lil bro

crimson plover
#

may i ask a coding question here?

slate swan
#

No

crimson plover
#

@commands.command()
@has_permissions(administrator=True)
async def announce(self, ctx, announcetext: str = None):
"""Sends an announcement to the Server"""
if announcetext is None:
await ctx.reply("You need to write something idiot..")
return
with Client(self.rconHost, self.rconPort, passwd=self.rconPassword, timeout=5.0) as client:
result = client.run(f"servermsg {announcetext}")
await ctx.send(result)

This code works... so if i use ~announce <message> it will i.e. "~announce this is the message" it will only print "this" the first word.... how do i get it to do the whole message?

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.

slate swan
#

Print the whole message or send the whole message?

crimson plover
#

send the whole message

#

so like "This is the message" it will only send "This" instead of "This is the message"

slate swan
#
(self, ctx, *, announcetext: str = None):
crimson plover
#

hm. didnt seem to work.

slate swan
#

Sounds like a skill issue

slate swan
crimson plover
#

thats my code

#

But as i said if i type a messgae it will only show the first word of the sentence

slate swan
#

Looks like a skill issue

zealous jay
#

how funny rat

slate swan
#

everyone is cackling

zealous jay
#

yes

slate swan
slate swan
#

Just make an error handler instead

crimson plover
#

cause i have skill issues

#

Never said i was good at this. sorry about wasting your time.. I know im stupid. Was just trying to figure out if it was something i just was not seeing

slate swan
#

@sick birch sorry for pinging but you probably know

zealous jay
#

No one said you are stupid, its okay to ask

slate swan
#

If all your trying to do is copy a message that you are sending with the bot command you can use “async def announcement(ctx,*,args):
await ctx.send(args)” to make bot send the message that you typed out in the same channel but you have to change the channel

torn sail
slate swan
torn sail
#

Yeah that’s interesting

slate swan
#

I'm guessing the logic is wrong

crimson plover
#

i mean any suggestions on what i should do with my code are welcome.. as i said it works... But still wont do the whole message i can do ~announce this is the message even with that code but it will only send the first word... first word being "this"

slate swan
#

Try “@bot.listen()
async def on_message(message):
if message.content.startswith("!Announcement"):
await message.channel.send(message.content)”

slate swan
#

@crimson plover just remove that None

#

and add error handler for missing arguments

zealous jay
#

btw slash commands make input easier

#

or at least for the user that uses the command

crimson plover
#

Thank you guys, Got it working

slate swan
torn sail
#

Was it the = None?

slate swan
#

I think he would've had to move that argument in order for it to work like that

#
    def check(reaction, user):
        return user == ctx.message.author and str(reaction.emoji) == '✅'
    await bot.wait_for('reaction_add', check=check)
    embed = Embed(color=discord.Color.dark_green(), title="Challenged", description=f"Game has been accepted by {user.mention}")
    embed.add_field(name="?", value="?", inline=True)
    embed.add_field(name="?", value="?", inline=True)
    confirmationMessage = await ctx.message.channel.send(embed=embed)
    await confirmationMessage.edit(embed=embed)
    await confirmationMessage.clear_reactions()```

In the Embed description, am I able to mention `only the user who has reacted` in the edited embed upon reaction? little stuck on how to implement this I can’t find the docs to learn about mentioning on reaction
torn sail
#

A default shouldn’t affect the consuming

slate swan
#

🤷

crimson plover
#

yes it was the none

#

thats the code that works now

torn sail
#

Not sure if this is what u want tho

slate swan
#

but as master said, you need to use the event too

crimson plover
#

ok...so the code works... and i know im asking a lot here... it doesnt bug me that much since it works but how would i go about handling this error... if anyone could link me to some error handling docs... or examples maybe..

#

obviously i commented out the code that doesnt work

drifting arrow
#

Is it possible to do the on_ready inside of a cog?

#

I want to load my bot and have loops automatically run once the bot starts.

ornate sail
#

is there any guide on how to start learning to make these bots

torn sail
unkempt canyonBOT
#

classmethod listener(name=...)```
A decorator that marks a function as a listener.

This is the cog equivalent of [`Bot.listen()`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Bot.listen "discord.ext.commands.Bot.listen").
ornate sail
drifting arrow
torn sail
#

although if u are talking about tasks.loop then i would start them in the __init__ and wait_until_ready in the before loop

drifting arrow
#

Oh

torn sail
#

but note that because nextcord is a fork less people would be able to help you with it

drifting arrow
#

@torn sail So this should work?

    @tasks.loop(seconds=300)
    async def statusupdater(self):
        await self.client.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name=f"{self.totalbans} bans"))
    
    @statusupdater.before_loop
    async def statusupdater_wait_for_ready(self):
        await self.client.wait_until_ready()```?
limber bison
#

I want to create vc here ! How can I create?

#

At the mid ?

#

Or at a possition

torn sail
#

!d discord.Guild.create_voice_channel

unkempt canyonBOT
#

await create_voice_channel(name, *, reason=None, category=None, position=..., bitrate=..., user_limit=..., rtc_region=..., video_quality_mode=..., overwrites=...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

This is similar to [`create_text_channel()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Guild.create_text_channel "discord.Guild.create_text_channel") except makes a [`VoiceChannel`](https://discordpy.readthedocs.io/en/latest/api.html#discord.VoiceChannel "discord.VoiceChannel") instead.

Changed in version 2.0: This function will now raise [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "(in Python v3.10)") instead of `InvalidArgument`.
torn sail
#

the positiion kwarg

crimson plover
#

anyone have any suggestions for me

worthy mortar
#

sorry, just getting here 🫥

crimson plover
#

Anyone who could help me handle this error? (The code works Im just not sure how to handle the error message if someone doesnt type a message in) So this error occurs if i do !announce with no message but !announce this is my message.. works completely fine no errors just was curious how to handle it

#

code works fine though.. i can live with the error since id never do it personally as it is for personal use just more curious how i would go about solving that

#

And yes. I am a noob

silk fulcrum
drifting arrow
silk fulcrum
torn sail
torn sail
drifting arrow
silk fulcrum
#

oh

crimson plover
#

yeah = None does not work

#

had to remove it.. once i did it worked properly with the *,

#

can someone show me an example of an errorhandler or link me?

torn sail
silk fulcrum
drifting arrow
#

Doing some googling.. is grabbing a webhook basically just doing an aiohttp request?

crimson plover
#

As i said this is for personal use the code works properly and im probably the only one to use it... but i am dumb and new to this...

crimson plover
#

some things ive figured out alright some things i havent figured out yet

drifting arrow
#

idk how webhooks work or what they really are

silk fulcrum
#

!d discord.ext.commands.Bot.on_command_error

unkempt canyonBOT
#

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

The default command error handler provided by the bot.

By default this logs to the library logger, however it could be overridden to have a different implementation.

This only fires if you do not specify any listeners for command error.

Changed in version 2.0: `context` and `exception` parameters are now positional-only. Instead of writing to `sys.stderr` this now uses the library logger.
silk fulcrum
#

there

torn sail
silk fulcrum
#

oh there is no example for it

torn sail
#

Well use on_command_error in a listener

drifting arrow
mossy jacinth
#

Can someone tell me why there is two "!!" In yhe status even tho it shouldnt be there?

torn sail
drifting arrow
crimson plover
#

@bot.event
async def on_command_error(ctx, error):
if isinstance(error, commands.CommandNotFound):
await ctx.send("Invalid command. Try using help to figure out commands!")
if isinstance(error, commands.MissingRequiredArgument):
await ctx.send('Please pass in all requirements.')
if isinstance(error, commands.MissingPermissions):
await ctx.send("**You dont have all the requirements or permissions for using this command **")

so would this work?

drifting arrow
#

i legit dont understand anything about this

#

so describing it. doing it. touching it. it's like all brand new to me

#

it might as well as be a foreign language to me

torn sail
scarlet sorrel
#

How to i end the entire process the bot is running on when a condition is met?

drifting arrow
scarlet sorrel
silk fulcrum
#

if condition: then await bot.close()

torn sail
scarlet sorrel
crimson plover
#

im so dumb

scarlet sorrel
#

If i just sent someone a dm with a bot how do i get the channel id of the dm before they send anything?

#

Basically how do i get the message object of the message i just sent?

#

Can i do var = await user.send(message) then var.channel.id

scarlet sorrel
#

Epic, thanks

drifting arrow
azure scroll
#

Is there something wrong with this? Because, this is the only command which does not respond.

@commands.command(aliases=['del', 'dn', 'delnote', 'delete', 'deletenote'], help = "Deletes a note you have written")
    async def delnotes(self, ctx, *, yourNote):
        check = await db.NoteBoyNotes.find_one({'_id':ctx.author.id}) 
        if (check is None):
            await ctx.send("User not found: Make a note to fix this")
        else:
            await notesCol.update_many({"_id" : ctx.author.id}, {"$pull" : {"notes" : yourNote}})
            await ctx.send("Ok, Deleted")```
drifting arrow
#

AAHH webhooks are annoying

maiden fable
#

Lol

drifting arrow
#

Alright. So, I manage to get a webhook id. and webhook object.
But I cant get the contents of it? the webhook i am using has a shared secret. How do I parse that through to pull the content?

maiden fable
#

content?

drifting arrow
#

Whatever is being sent to my discord server..

#

the json file.. the text. whatever they're sending