#discord-bots

1 messages Β· Page 390 of 1

hard jay
#

They also will recieve the transcript when the ticket is closed

fast osprey
#

That doesn't address either of the things I said

fast osprey
#

I've seen a thousand of these "ticket bots" and just making threads solves 95% of the problem on its own. That is the transcript, the users still control their own messages, you barely have to write anything. Or you can make your own thing and then you need to deal with privacy headaches. Your call

nocturne saffron
#

hey guys if i want a slash command in my discord bot to have a cooldown how can i do this

vocal laurel
#

!d discord.app_commands.Cooldown

unkempt canyonBOT
scarlet wren
#

what is the import to make discord bots? import pycord or what

stark ingot
#

It depends on what library you are using.
For py-cord it is import discord.

#

Keep in mind import names can be different from library names. So discord.py also uses import discord so you can only have one or the other installed

scarlet wren
#

whats the best

stark ingot
#

There is no best. It depends on what you like. You should use whatever you are used to. Or look at the docs and examples for each and decide what you like the most.

scarlet wren
#

instead of console so it logs

nocturne saffron
fast osprey
#

For just sending things to a webhook, all of the libraries are basically equivalent tbh. Hell, you don't even need a library, you could just post to the endpoint directly if you wanted

sick birch
#

yeah depending on how much complex stuff you want to send i'd just use requests

young dagger
#

aiohttp for asynchronous requests

dapper cobalt
#

Np, sometimes very small un-noticeable things can break our whole code

copper flume
#

Hi, if my bot is autosharded then will it make as more shard as it requires?
discord.py

sturdy token
#

Yo anyone interested in collabing on a discord bot?

mint pecan
#

when i call a group command in discord and print ctx.command.name it only prints the group's name how can i get the name of the subcommand?

slate swan
#

!d discord.ext.commands.Command.qualified_name # A quick search on the documentation

unkempt canyonBOT
#

property qualified_name```
Retrieves the fully qualified command name.

This is the full parent name with the command name as well. For example, in `?one two three` the qualified name would be `one two three`.
slate swan
#

!d discord.ext.commands.Command.full_parent_name # Also something useful

unkempt canyonBOT
#

property full_parent_name```
Retrieves the fully qualified parent command name.

This the base command name required to execute it. For example, in `?one two three` the parent name would be `one two`.
dire timber
#

Hi
I'm trying to convert some prefix commands into hybrid commands and I seem to have run into an error

The error:
TypeError: unsupported parameter kind in callback: VAR_POSITIONAL

The code I made changes to:

    @commands.hybrid_command()
    async def buildnotation(self, ctx: commands.Context):
        embed = discord.Embed(title="",description="")
        await ctx.send(embed=embed)
    
    @commands.hybrid_command(aliases=["affix"])
    async def affixguide(self, ctx: commands.Context):
        embed = discord.Embed(title="",description="")
        await ctx.send(embed=embed)
mint pecan
wanton current
dire timber
# wanton current Can you send the entire tracekback?

this is pretty much it

Extension unloaded!
Failed to reload cogs.builds: Extension 'cogs.builds' raised an error: TypeError: unsupported parameter kind in callback: VAR_POSITIONAL
Extension unloaded!
Failed to reload cogs.builds: Extension 'cogs.builds' raised an error: TypeError: unsupported parameter kind in callback: VAR_POSITIONAL
#

I did ask in the discord.py server and I was told that hybrid commands cannot take in unlimited parameters

wanton current
#

Yeah, but are you even doing *, args or *args anywhere

dire timber
#

yes

#

it's not in that code block but one of my commands which i tried to convert has a *args

wanton current
#

That's the problem then

#

Discord needs to know how many arguments to display when trying to use your command, so you can't have a dynamic amount of them.

#

What are you trying to do with that command?

slate swan
dire timber
# wanton current What are you trying to do with that command?

the reason for the variadic arguments is because of the users who I'm building it for (they like having nicknames with multiple words)

whatever the user types as the arguments will be combined into a single string and then checked to see if a name exists for that said nickname string

hushed galleon
dire timber
#

yea i figured

#

I'm looking into it now

#

but for the commands that do not require arguments I've converted those already

#

thanks

mint pecan
vale bough
#

anyone

#

i need help

young dagger
#

9-20 20:13:52 ERROR discord.ui.view Ignoring exception in view <VerificationView timeout=None children=1> for item <Button style=<ButtonStyle.secondary: 2> url=None disabled=False label='Click to Verify' emoji=<PartialEmoji animated=False name='check_mark' id=1185706844665159820> row=None sku_id=None> Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/discord/ui/view.py", line 430, in _scheduled_task await item.callback(interaction) File "/cogs/verification.py", line 85, in start_verification await interaction.response.send_message(embed=embed, file=file, view=view, ephemeral=True) # noqa ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/discord/interactions.py", line 855, in send_message await adapter.create_interaction_response( File "/usr/local/lib/python3.12/site-packages/discord/webhook/async_.py", line 221, in request raise NotFound(response, data) discord.errors.NotFound: 404 Not Found (error code: 10062): Unknown interaction

sick birch
sick birch
#

I believe the response on line 66 is also running

young dagger
#

discord.errors.DiscordServerError: 503 Service Unavailable (error code: 0): upstream connect error or disconnect/reset before headers. reset reason: overflow

young dagger
#

Because I'm getting the same with Python bot from this server

zinc gust
#

lemme try with my bot

#

yes

#

discord issue, interactions arent working with my bot aswell

sick birch
#

cant tell. Would recommend waiting till discord resolves their issues then trying after that to see if it’s on your end or theirs

zinc gust
young dagger
young dagger
sick birch
#

so it was a discord issue then

young dagger
sick birch
#

there isn't really much you can do beside ignoring them

young dagger
sick birch
#

nah

mint pecan
#

How can i get the subcommand when someone use group commands? ctx.command is pointing to the group and ctx.invoked_subcommand is always None

charred estuary
#

Excuse me sir, I want to ask, does anyone know how to create a test format like this?

#

@charred estuary -# just order DF

charred estuary
zinc gust
#

just put the -# at the beginning

charred estuary
charred estuary
hushed prairie
#

are there any perks for active developer or just the badge?

mint pecan
vocal laurel
unkempt canyonBOT
#

The command names of the parents that triggered this invocation. Useful for finding out which aliases called the command.

For example in commands ?a b c test, the invoked parents are ['a', 'b', 'c'].

New in version 1.7.

vocal laurel
#

@mint pecan not sure ur looking for this

#

Oh subcommands

#

Sorry for the ping

vale bough
#

[2024-09-21 09:01:26] [INFO ] discord.player: ffmpeg process 7880 successfully terminated with return code of 3199971767.

#

anyone know about this?

vale bough
slate swan
#

!ytdl

unkempt canyonBOT
#
Our youtube-dl, or equivalents, policy

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

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

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

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

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

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

@vocal laurel

vocal laurel
young dagger
#

Good practice to use different rate limits?

# Riot API rate limit
lol_summoner_v4_summoners = AsyncLimiter(1600, 60)
lol_league_v4_entries = AsyncLimiter(100, 60)
riot_account_v1_accounts = AsyncLimiter(1000, 60)
shrewd apex
#

yeah

timber dragon
#

Set sensible limits, not just random lol

idle badge
#

Can I get someone to collaborate with me in debugging my code?

mint pecan
#

how can i get the subcommand called by the user? this was my code

    @commands.hybrid_group()
    @commands.guild_only()
    @commands.is_owner()
    async def test(self, ctx: commands.Context):
        ...

    @test.command()
    async def a(self, ctx: commands.Context) -> None:
        print(ctx.invoked_subcommand)

when i call a it still prints None

idle badge
#

"Discord is not defined"

fast osprey
#

So true

#

Do you have code? A full error and traceback?

pulsar flume
#

Hi guys I am Julia 😺

main holly
young dagger
#

A server error occurred. Please try again in a minute.

smoky patrol
#

channel: discord.TextChannel = None

how can i make it possible to select more than one channel at a time using slash commands

#

async def channel(interaction: discord.Interaction, mode: discord.app_commands.Choice[str], channel: discord.TextChannel = None, category: discord.CategoryChannel = None):

fast osprey
#

You cannot

#

Best option is to modify your flow to present the user with a ChannelSelect, which can accept multiple inputs. But generally slash commands do not support list inputs

smoky patrol
fast osprey
#

Depends a bit. Do you know how to send selects/views generally?

smoky patrol
#

like the forms

fast osprey
#

https://github.com/Rapptz/discord.py/blob/master/examples/views/dropdown.py is an example of a regular dropdown with manually populated options. You could instead subclass discord.ui.ChannelSelect, then you only need to implement the callback. You could also do this with the @discord.ui.select decorator in a view class, using the above ChannelSelect class as the cls= parameter

GitHub

An API wrapper for Discord written in Python. Contribute to Rapptz/discord.py development by creating an account on GitHub.

worthy zephyr
#

my requirement file is discord
py-cord==2.4.1
discord-py-slash-command==4.2.1
tesseract==0.1.3
aiohttp==3.8.1
Pillow==9.1.1
python-dotenv==0.21.0

viscid hornet
#

discord_slash isnt a real thing anymore. it's integrated with discord now

#

SlashCommand is just @app_commands.command() and SlashContext is just Interaction

scarlet tiger
jovial tusk
#

How do you make a py bot to automatically send messages, for example /setting<token> <channel1> <message>
Well, the bot logs into the user account to automatically send messages. Does anyone know how?

jovial tusk
#

yea but setting via discord bot

slate swan
#

yea, thats not allowed so we cant help

#

!rule 5

unkempt canyonBOT
#

5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.

jovial tusk
#

oke

worthy zephyr
vocal laurel
#

Share your code here

mint pecan
#

i am getting

TypeError: Command.__init__() missing 1 required positional       
argument: 'func'

trying to create a hybrid group

class test(Cog):

    foo = commands.HybridGroup()

    @foo.command()
    async def a(self, ctx: commands.Context) -> None:
        pass

what does that even mean

stark ingot
mint pecan
golden portal
mint pecan
golden portal
#

then that's not a hybrid, thats just a regular group foo = app_commands.Group()

fast osprey
#

This is one of the multiple cases where hybrids break down because these systems function fundamentally differently

golden portal
#

its true, tho i love hybrid to the core

jovial tusk
copper flume
#

is this the plan for a discord bot host?

#

in hetzner

fast osprey
#

"Discord bot" is entirely too vague

#

We can't tell what your bot needs

copper flume
fast osprey
#

That still doesn't really help

#

You should profile your bot, see what resources it uses, and make an informed decision

#

Or just guess and hope DuckBotShrug

copper flume
#

2gb ram is enough for me

fast osprey
#

Ram is not the singular only thing to profile

copper flume
# fast osprey Ram is not the singular only thing to profile
Using 750.75 MiB physical memory and 778.44 MiB virtual memory, 747.41 MiB of which unique to this process.
Running on PID 13820 (python.exe) with 12 thread(s).

This bot is automatically sharded (Shards 0 of 1) and can see 932 guilds and 443456 users.

good?

#

3k commands are used daily

fast osprey
#

Not really, what you're specifically asking about is cpu even

#

We can't look at "3k commands" and in our brains calculate what resources that uses

zinc gust
copper flume
zinc gust
zinc gust
copper flume
#

it sucks

zinc gust
#

how

copper flume
#

worst cpu

zinc gust
#

ur bot literally gets hosted in new york for 8.50 a year

copper flume
#

a VPS?

zinc gust
copper flume
#

or pterodactyl

zinc gust
#

pterodactyl ig

copper flume
#

then it sucks

zinc gust
#

cuz they got a free offer aswell that im currently using

#

the free one is pterodactyl but idk about the paid one

coral wigeon
#

I need some help real quick

#

Exception has occurred: PrivilegedIntentsRequired
Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to and explicitly enable the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead.
discord.gateway.WebSocketClosure:

During handling of the above exception, another exception occurred:

discord.errors.ConnectionClosed: Shard ID None WebSocket closed with 4014

During handling of the above exception, another exception occurred:

fast osprey
#

The error tells you directly what you need to do

coral wigeon
#

ah shit

young dagger
#

Is there any different between asyncio.sleep and delete_after?

fast osprey
#

That's essentially all delete_after is doing under the hood, just spawning an asyncio task that sleeps and then deletes

young dagger
#

So less code?

fast osprey
#

I guess, not that that's something you should really be optimizing on

#

less code != better

surreal cliff
#

A big ask!

I run a discord server of over 20,000 members. I've created a discord bot that handles ticketing and a reputation system. I'm having a few error logs and issues with the script; I'm by no means an expert in Python and must admitt that most of my coding has been done via using ChatGPT (Apologies in advance!)

Is there anyone kind enough that has some experience in coding to review and assist? I'd be forever greatful! πŸ™‚

fast osprey
#

Feel free to share your code here and ask about specific bits that aren't working or what you want help with

#

as general advice, chatgpt will straight up lie to you pretty often. You should never use it for things you aren't already an expert in

stark ingot
#

Very few people here who know what they are doing want to make long term commitment.
Also, as solstice said, depending on what library you use chatGPT will know nothing to little. ChatGPT was trained on 2022 data so it does not know about many new discord features.

hard jay
#

@ashen notch

#

Am trying to make the same transcript like in the ticket tool for discord

#

I have made my own ticket bot but i don't know how to implement it like in the ticket tool transcripts, can someone help me?

fast osprey
#

I strongly suggest you implement these as discord threads, which you can archive and are automatically a "transcript". If you are taking peoples' messages and putting them somewhere else, you are going to want to familiarize yourself with the developer TOS

crude remnant
#

Can someone help me fix this error

  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/discord/client.py", line 449, in _run_event
    await coro(*args, **kwargs)
  File "/data/data/com.termux/files/home/fcso2.py", line 14, in on_ready
    await bot.tree.sync()  # Sync the command tree
    ^^^^^^^^^^^^^^^^^^^^^
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/discord/app_commands/tree.py", line 1134, in sync
    raise CommandSyncFailure(e, commands) from None
discord.app_commands.errors.CommandSyncFailure: Failed to upload commands to Discord (HTTP status 400, error code 50035)
In command 'infraction' defined in function 'infraction'
  In parameter 'infraction'
    choices.0.name: Must be between 1 and 100 in length.```
sick birch
crude remnant
#

Thanks for the help

hard jay
#

Ticket Tool for discord already has that option built in

#

So when a ticket is closed it will send them the transcript

#

which is not against the tos

mint pecan
golden portal
#

because prefix group can be called, unlike slash group

mint pecan
#

i have a problem with discord.py contexts inside bot.process_commands

    async def process_commands(self, message: discord.Message) -> None:
        if message.author.bot:
            return
        
        ctx = await self.get_context(message)
        command = ctx.command
        
        if command:
            print(command.name)

        await self.invoke(ctx)

when someone call a group command !<group> <subcommand> <args>
ctx.command gives me the group instead of the subcommand
how do i get the subcommand before it gets invoked?

livid hare
#

What libraries should I use to connect discord - roblox and getting logs when game joins

#

I want to try

sick birch
unkempt canyonBOT
livid hare
#

Libraries

fast osprey
#

Just because someone does something does not mean it's fine for you to do it too

slate swan
#

guys

#

what code does discord bots run witgh

#

python or html or what

dapper cobalt
# slate swan python or html or what

HTML is NOT a programming language. It's a markup language which is used to build base structure of web apps.
Python is a programming language, and yes it's used for building discord bots (while this is not its only purpose, and it's not the only language used for that)

slate swan
dapper cobalt
slate swan
dapper cobalt
dapper cobalt
slate swan
#

like I made that calc now how do I make a UI design for it then match it with that

#

🀯 bruh my brain exploded nvm

unkempt canyonBOT
#

Source code: Lib/tkinter/__init__.py

The tkinter package (β€œTk interface”) is the standard Python interface to the Tcl/Tk GUI toolkit. Both Tk and tkinter are available on most Unix platforms, including macOS, as well as on Windows systems.

Running python -m tkinter from the command line should open a window demonstrating a simple Tk interface, letting you know that tkinter is properly installed on your system, and also showing what version of Tcl/Tk is installed, so you can read the Tcl/Tk documentation specific to that version.

slate swan
viscid hornet
viscid hornet
slate swan
viscid hornet
dapper cobalt
slate swan
slate swan
mint pecan
mint pecan
#

im not sure why but it's still none after invoking

young dagger
unkempt canyonBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

dry kelp
hasty pike
#

role is getting none and value is role id

fast osprey
#

What is value?

hasty pike
#

Role id

#

Constant

#

@Is_mod("1287796953626841229")

wanton current
#

needs to be an integer

hasty pike
#

Oh

#

Worked!

wanton current
#

nice

mint pecan
dry kelp
#

@unkempt canyon eval

unkempt canyonBOT
#
Missing required argument

code

dry kelp
#

@unkempt canyon eval sum([i2 for i in range(107)])

unkempt canyonBOT
dry kelp
#

@unkempt canyon eval ,eval "A" * 10**6

unkempt canyonBOT
dry kelp
#

://

#

@unkempt canyon eval (lambda fib: (lambda f, n: f(f, n))(lambda f, n: n if n <= 1 else f(f, n-1) + f(f, n-2), 35))(0)

unkempt canyonBOT
fast osprey
#

#bot-commands

slate swan
livid sorrel
#
    def __init__(self, options, ans):
        super().__init__(timeout=None)
        self.options = options
        self.ans = ans

        for option in options:
            async def button_callback(button, ctx):
                if button.label == self.ans:
                    await ctx.send("Correct answer!")
                else:
                    await ctx.send("Incorrect answer.")

            button = discord.ui.Button(label=option, style=discord.ButtonStyle.primary)
            button.callback = button_callback
            self.add_item(button)

I'm trying add buttons dynamically, the problem i am facing is that when i click the buttons there's no responce... i am not able to find and locate any errors as well. can someone help me fix this.

fast osprey
#

You should be subclassing Button, not making generic buttons and stapling callbacks onto them

hushed galleon
livid sorrel
#

i figured it out

#

thanks solstice

young dagger
#

How do you delete a interaction.response?

fast osprey
#

Why? Could just make it ephemeral

young dagger
fast osprey
#

Why?

young dagger
#

Do you actually know how to delete it?

#

Because there is a selection that I don't want them be able to change afterwards

hushed galleon
#

if you have an interaction coming from a message component on that message, you might find it nicer to disable those components or remove them via edit_message()

fast osprey
#

Yeah almost in all circumstances there is a more intuitive flow than just deleting messages underneath users

young dagger
fast osprey
#

There is,

wanton current
#

however

fast osprey
#

but again this is really shitty ux for users to have things randomly disappear

young dagger
#

How can you delete it?

#

If there is a way to delete it, I want to learn how

fast osprey
#

That basically tells us you're ignoring the advice

hushed galleon
#

deleting the message of an interaction can be done with interaction.delete_original_response(), although you have to keep in mind that the message it deletes somewhat confusingly depends on your initial response

young dagger
fast osprey
#

That has to be done after responding

young dagger
#

Oh so you can't actually delete it without responding?

wanton current
#

What? What is there to delete if you don't respond in the first place?

fast osprey
#

What is "it"?

young dagger
#

There is a message

#

I want to delete the second message after they picked their role

fast osprey
#

They can dismiss it

#

why do you feel the need to delete it for them

young dagger
hushed galleon
#

hmm, having the message get edited to say "Successfully selected @role as your primary role!" would look nice

fast osprey
#

You can disable/remove the selector and give them a nice message explaining as such

#

As a user using any system, if you interacted with something and then it just suddenly disappeared from your vision, that's not a very good UX is it? People would reasonably assume it broke.

||If you really want to, you could respond with a defer() and then use delete_original_response. This is horrid UX for no reason when there is a very clear way to communicate to the user what is happening instead with no cost to you or them, but do what you will||

young dagger
young dagger
#

Is it not possible to add emojis to the selection?

hushed galleon
#

only via the separate emoji= parameter for SelectOption

young dagger
#

Oh alright

young dagger
#

This is how it looks now

fast osprey
#

Looks great

elfin aurora
#

do anyone uses hata from pypi to make discord bots

gleaming inlet
#

!pip hata

unkempt canyonBOT
#

A powerful asynchronous library for creating Discord bots in Python.

Released on <t:1726429493:D>.

timber dragon
#

We all hata that

elfin aurora
timber dragon
#

Nope

naive cloud
#

yo my bot ai cog thing word restriction thang, i dont know how to implement that, i tried doing all sorts of stuff but the bot keeps generating the message too long and discord would not accept it

https://paste.pythondiscord.com/OK6Q

golden portal
#

i mean you only restrict that to 500 words, which can go above the 2000 char limit if words are on average 4 character

#

!d textwrap.wrap perhaps you might want that

unkempt canyonBOT
#
textwrap.wrap(text, width=70, *, initial_indent='', subsequent_indent='', expand_tabs=True, replace_whitespace=True, fix_sentence_endings=False, break_long_words=True, ...)```
Wraps the single paragraph in *text* (a string) so every line is at most *width* characters long. Returns a list of output lines, without final newlines.

Optional keyword arguments correspond to the instance attributes of [`TextWrapper`](https://docs.python.org/3/library/textwrap.html#textwrap.TextWrapper), documented below.

See the [`TextWrapper.wrap()`](https://docs.python.org/3/library/textwrap.html#textwrap.TextWrapper.wrap) method for additional details on how [`wrap()`](https://docs.python.org/3/library/textwrap.html#textwrap.wrap) behaves.
livid hare
#

someone answer should i learn all string methods from python it's too much and boring or tell me which one is important to learn

#

i want to learn which worth to learn

exotic drum
livid hare
#

isalpha

#

i ssee but hard i think

#

idk how to use in practice with list

#

hard moment

#

and count i don't see and try

exotic drum
#

@livid hare at least imo sitting down and learning them all to heart isnt really worth it.
If I were you and wanted to learn more about them, I would get a list of them online and just skim down them. Most are self explanatory and won't really need specific practice putting in. Focus your time on the ones that dont make sense to you at a glance. Outside of that you can just learn them as and when you need them and you'll naturally end up knowing the ones that are most useful to the sort of things you use python for

livid hare
#

ok

#

should i gnore then cuz i'm going to learn unity now

#

and aafter object oriented oop

#

basics

exotic drum
#

yeah I think you should just focus on things as and when you need them., its really overwhelming trying to know everything all at once lmao. If you want to go towards using unity just learn about the things you need as you go, you'll eventually develop your knowledge in a way that doesnt make you quit or get bored

livid hare
#

ok

twin crystal
#

Hello

#

Can someone can teach me how to make a working discord bot?

#

I just need a ticket,self roles,moderation bot

fast osprey
#

If you want to allow users to opt into roles, this is very easily done with the built-in Channels & Roles menu in the server onboarding settings

twin crystal
#

Oh thanks

#

For moderation just use auto mod?

fast osprey
#

For the other things, you'll need to more explicitly map out the behavior and user flow that you want. In any discord library you pick, there will be examples for "hello world" type bots that you can start from

fast osprey
# twin crystal For moderation just use auto mod?

"moderation" is a very very broad term, and it depends on what you specifically want to do. TBH, a lot of bots just reimplement what already exists in the client but in a less secure and less functional way

#

There are some novel bits of moderation processes that don't exist natively in the client which you may want, but that's up to you

twin crystal
fast osprey
#

Yeah you absolutely want to use automod for that

twin crystal
#

Okay

fast osprey
#

bots can create automod rules, but automod should be the mechanism

twin crystal
#

Okay thanks

young dagger
#

Just made this with Easy PIL

#
  • some basic Photoshop
#

(yeah I know the numbers are not accurate)

exotic hazel
sick birch
#

the image generation presumably

slate swan
#

can you make a button dependent on another button?

#

for example if you click on button1 it makes button2 disabled

hushed galleon
#

sure, assuming you're using discord.py views, you can change the attributes of your components and edit the message with the same view to refresh it

#

for example, making two buttons that can flip-flop between each other: ```py
class MyView(discord.ui.View):
@discord.ui.button(label="Hello")
async def hello(self, interaction, button):
self.hello.disabled = True
self.world.disabled = False
await interaction.response.edit_message(view=self)

@discord.ui.button(label="World!", disabled=True)
async def world(self, interaction, button):
    self.hello.disabled = False
    self.world.disabled = True
    await interaction.response.edit_message(view=self)```
slate swan
hushed galleon
#

discord.py is doing some magic to make the buttons accessible through their method names

hushed galleon
# sick birch what exactly is it doing?

iirc the decorators store the component arguments on the function objects, then View.__init_subclass__ gathers them all, and View.__init__ creates the components and simply assigns each of them to the same method name

slate swan
sick birch
hushed galleon
slate swan
sick birch
#

you tested that exact code?

naive cloud
golden portal
#

read textwrap.wrap

pine granite
#

anyone know a website to learn to code discord bots for free

fast osprey
#

There's two very importantly distinct steps here: learning how to program/use python generally, and how to apply a specific library

pine granite
#

well any1 know a free website that can run my python code for my bot and take the .env file asw?

wanton current
#

no

stiff igloo
stark ingot
#

Really any free host is going to have major downsides.

boreal kraken
#

Hey guys, I'm designing a discord bot and I notice that every newly joined user in a server gets this icon;

#

The div is class is newMemberBadge_ed263a

#

The little green heart

#

Is there any way to detect this with my discord bot?

stark ingot
#

If i recall correctly that is shown for 1 week after a user joins a server for the first time. So you can just look at the join data of the user and calculate a week

stiff igloo
fast osprey
#

There is the unspoken option of taking that time you would spend wrestling with shitty options and instead allocate that time into acquiring currency (a process known as "work")

modern valve
#
    @qotd.command()
    async def setchannel(self, ctx, channel: discord.abc.GuildChannel):
        ...

why doesnt this run whatsoever

#

i did try setting it to TextChannel

fast osprey
#

What are you doing (in discord), and what happens? What's the rest of your code? Are there any errors? How do you know if you're trying to run this code at all?

modern valve
fast osprey
#

what's your full code, do you get any logs at all from the library

modern valve
#

nope

#
@qotd.command()
    async def setchannel(self, ctx, channel: discord.TextChannel):
        try:
            print("Check Roles")
            if not self.has_required_role(ctx):
                print("not beta")
                await ctx.reply(NoBetaMessage)
                return

            print("Passed role")

            guild_id = str(ctx.guild.id);print("Set guild_id")

            try:

                # Ensure QOTD[guild_id]["questions"] exists before modifying it
                print("initial check")
                if guild_id not in QOTD or "questions" not in QOTD[guild_id]:
                    await ctx.reply("Configuration not found for this server.")
                    return

                print("setting channel")
                # Update the appropriate channel
                QOTD[guild_id]["questionsChannel"] = channel.id

                await ctx.reply(f"Set Questions Channel to {channel.name}")
            except Exception as e:
                await ctx.reply(f"Error: {type(e).__name__} | {e}")
        except Exception as e:
                await ctx.reply(f"Error: {type(e).__name__} | {e}")

NONE of the debug runs and no errors are passed

#

and when channel is "str" it runs every time

fast osprey
#

full, as in all of it

modern valve
#

uh?

#

the Cog or

fast osprey
#

all of it

modern valve
#

i dont exactly host it anywhere

#

why do u need it?

fast osprey
#

or at minimum, how you're creating your bot object and starting it

modern valve
#

oh just the start and initial "bot" creation

#
intents = discord.Intents.default()
intents.members = True
intents.messages = True
intents.presences = True
intents.message_content = True
bot = commands.Bot(command_prefix=botprefix, intents=intents)
# yes i know my run() function isnt as normal, its because i kinda need things saved without the file IMMEDIATELY closing
def run(
        self,
        token: str,
        *,
        reconnect: bool = True,
        log_handler: logging.Handler | None = discord.utils.MISSING,
        log_formatter: logging.Formatter = discord.utils.MISSING,
        log_level: int = discord.utils.MISSING,
        root_logger: bool = False,
    ) -> None:
        async def runner():
            async with self:
                await self.start(token, reconnect=reconnect)
        if log_handler is not None:
            discord.utils.setup_logging(
                handler=log_handler,
                formatter=log_formatter,
                level=log_level,
                root=root_logger,
            )
        try:
            asyncio.run(runner())
        except KeyboardInterrupt:
            with open(afkdir, "w") as t:
                json.dump(afk_users,t)
                print("AFK file updated.")
            with open(warningdir, "w") as t:
                json.dump(warnings,t)
                print("Warning file updated.")
            with open(quotesdir, "w") as t:
                json.dump(quotes,t)
                print("Quote file updated.")
            print("Files updated. Bot closing.")
            return

try:
    run(bot, TOKEN)
except KeyboardInterrupt:
    with open(afkdir, "w") as t:
        json.dump(afk_users,t)
        print("AFK file updated.")
    with open(warningdir, "w") as t:
        json.dump(warnings,t)
        print("Warning file updated.")
    with open(quotesdir, "w") as t:
        json.dump(quotes,t)
        print("Quote file updated.")
    print("Files updated. Bot closing.")
except Exception as e:
    raise(e)
fast osprey
#

what log level are you using? Is anything being sent to it?

modern valve
#

log level?

fast osprey
#

That's in your own code 🀨

modern valve
#

i dont know what a log level is

fast osprey
#

Then why is it in your code?

modern valve
#

idk someone told me to get the run statement from discord.py

fast osprey
#

yeah all of this is unnecessary

modern valve
#

and then that should let me press CTRL+C, save my files THEN close

fast osprey
#

you can replace all of it with just bot.run instead and get default logging to your console

#

you shouldn't ever copy paste code you don't understand

modern valve
#

yea but if i do that, i cant close the bot AND save data like AFK, quotes, etc

#

with this i can close it then save my files

fast osprey
#

huh

#

nothing about bot.run precludes you from saving files

#

you also really shouldn't be using flat files to record data, that's what databases are for

modern valve
#

no like, okay

i use bot.run and i press CTRL+C KeyboardInterrupt to close, and nothing gets saved

fast osprey
#

And nothing about bot.run itself stops that

modern valve
modern valve
wanton current
#

why would you only save when keyboard interrupting? what if the bot crashes?

modern valve
# modern valve ???

i probably fucked up my code when starting the project πŸ‘
(this bot is basically the only reason i even know how to code in Python)

jaunty cape
smoky quiver
solar pollen
#

if my bot get used in 1000 different servers do I get ratelimited?

fast osprey
#

Depends what your bot does

slate swan
#

Actually im a new programer

exotic hazel
fast osprey
#

Yup take it at a reasonable pace and learn the building blocks

stark ingot
# solar pollen if my bot get used in 1000 different servers do I get ratelimited?

Like solstice said it depends.
In general whatever library you are using should handle minor ratelimit violations automatically.
The global ratelimit is 50 requests per second which is actually quite high even for a large bot. Note that interaction responses such as slash command and button responses do not count for this 50/sec limit.
So as long as your bot is doing normal things, and not sending a message to all servers at once or editing a bunch of users roles in a burst action you should be fine

pine granite
#

anyone know why this is happening

#

ive already pip installed it

cinder tulip
#

anyone able to help with user install command?

golden portal
#

just ask the question

cinder tulip
#

Idk what to say bro, I just enabled it on the portal and followed some guy that was having my struggle on GitHub.
I added this on the code:

@app_commands.command()
@app_commands.allowed_installs(guilds=False, users=True)
@app_commands.allowed_contexts(guilds=True, dms=True, private_channels=True)
async def useable_only_users(interaction: discord.Interaction):
    await interaction.response.send_message("I am only installed to users, but can be used anywhere.")

and just tried with a command:

@client.tree.command(name="ms", description="Check the bot's latency.")
@app_commands.user_install()
async def latency(interaction: discord.Interaction):
    embed = discord.Embed(title="Pepsi-Latency:", description=f"{round(client.latency * 1000)}ms", colour=discord.Color.blue())
    await interaction.response.send_message(embed=embed)

and idk it just doesnt work. I haven't really coded lately so I'm struggling right now

#

I am really lost on what i need to do

#

If I go on my dms and try writing the "/" it just wont pop the bot's commands up

golden portal
#

did you sync

cinder tulip
golden portal
#

not necessarily, you can do it in bot.setup_hook

cinder tulip
#

I synced on the on_ready my tree commands

golden portal
#

i see

cinder tulip
#

try:
synced = await client.tree.sync()
print(f"Synced {len(synced)} command(s).")
except Exception as e:
print(e)

golden portal
#

did it print

cinder tulip
#

Synced 12 command(s).

#

theres this from the thingy i sent

golden portal
#

try reloading your discord client to see if it appears

cinder tulip
#

but it doenst say anything about user installed commands since i didnt do anything

golden portal
#

it doesnt really say it, its a slash command anyways, as long as you add your bot to have user install + reloaded the client + sync it should appear

cinder tulip
#

I just restarted my client and it still doesnt work

golden portal
#

whats your user installs scope in the discord api portal

cinder tulip
golden portal
#

and you did use the install link right

cinder tulip
#

Yeah I did

#

obv its a discord provided link, but i dont think that means much

pine granite
golden portal
#

it does since it allows you to install it

golden portal
pine granite
#

ok

cinder tulip
#

like when i click on try and authorize the app it opens that if i click on open app

#

but that's on the server and on the bot's dms. doe it just aint working in dms

#

theres nothing

golden portal
#

did you even add it to the tree

cinder tulip
golden portal
#

then it wont be added, use @bot.tree.command() instead of @app_commands.command()

cinder tulip
#

then in this case:

@client.tree.command(name="ms", description="Check the bot's latency.")
@app_commands.user_install()
async def latency(interaction: discord.Interaction):

    embed = discord.Embed(title="Pepsi-Latency:", description=f"{round(client.latency * 1000)}ms", colour=discord.Color.blue())

    await interaction.response.send_message(embed=embed)

what do i do

#

do i just remove @app_commands.user_install()

golden portal
#

your latency should have the allowed_contexts private_channels

#

user_install is correct

cinder tulip
#

so wait do i just need to allow private channels on every client tree command?

golden portal
#

only for user installs

cinder tulip
#

would the code be sum like this 😭 ? :

@client.tree.command(name="ms", description="Check the bot's latency.")
@app_commands.user_install()
@app_commands.allowed_contexts(private_channels=True)
async def latency(interaction: discord.Interaction):

    embed = discord.Embed(title="Pepsi-Latency:", description=f"{round(client.latency * 1000)}ms", colour=discord.Color.blue())

    await interaction.response.send_message(embed=embed)
golden portal
#

yea

#

now just sync and restart the discord client

cinder tulip
#

you deserve a villa and a few mil dollars

golden portal
#

okie

cinder tulip
#

wait @golden portal the commands i put the private channels true on dont work in servers doe??

#

do i just guild=true?

golden portal
rose narwhal
sick birch
#

making your bot instance an importable singleton is also common

rose narwhal
#

hm

naive cloud
#

yo

sick birch
#

yo

rose narwhal
#

yo

midnight oracle
#

yo

blissful crane
#

yo

steep vine
#

How do I get rid of the flashing bug in VS Code, bro?

wanton current
#

?

timber dragon
#

!

smoky patrol
#

how can i send a dm to the user as soon he authorized

fast osprey
#

Is this an oauth flow?

stark ingot
#

If you are authorizing a user app discord has not made a event for knowing when a user add the bot to their account yetℒ️

wanton current
#

Can't you add a redirect url and know that way

latent marsh
#

When I try and invite my bot to my server, it says 'instalation type not supported for this application' how can I get past this?

hushed galleon
latent marsh
#

oh i put it as user install

hushed galleon
#

that one's for authorizing a user to use some/all of your commands anywhere

latent marsh
#

Ah i see.Works like a charm now! thank you so much for your help πŸ™πŸ»

mint pecan
#

does autocomplete work for prefix commands?

vocal laurel
#

Nope

thin raft
#

what else should return?

#

!d intents

unkempt canyonBOT
#

Unable to parse the requested symbol due to a network error.

thin raft
#

!d discord.Intents.members

unkempt canyonBOT
#

Whether guild member related events are enabled.

This corresponds to the following events...

thin raft
#

show code

#

and in dev portal?

slate swan
#

You don't need the intent to get info about the message's author

#

And the bot won't even start if it's enabled in code and not in the portal

#

!d discord.User.banner

unkempt canyonBOT
#

property banner```
Returns the user’s banner asset, if available.

New in version 2\.0\.

Note

This information is only available via [`Client.fetch_user()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Client.fetch_user).
slate swan
#

See the note

#

Unfortunately yep

fast osprey
#

Or cache it to your liking. Discord doesn't send it on the standard user object

slate swan
#

Yeah you can cache and add some command flag to force fetching it again

#

Technically yes, pretty sure it's internal code

mint pecan
#

how can i check if an user is banned?

slate swan
unkempt canyonBOT
#

async for ... in bans(*, limit=1000, before=..., after=...)```
Retrieves an [asynchronous iterator](https://docs.python.org/3/glossary.html#term-asynchronous-iterator) of the users that are banned from the guild as a [`BanEntry`](https://discordpy.readthedocs.io/en/latest/api.html#discord.BanEntry).

You must have [`ban_members`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions.ban_members) to get this information.

Changed in version 2\.0: Due to a breaking change in Discord’s API, this now returns a paginated iterator instead of a list.

Examples

Usage...
copper flume
#
@commands.Cog.listener('on_message')
    async def chatbot_response_back(self, message: discord.Message):```

How do I detect if the message is a command and if so, then stop the command execution
fast osprey
#

Listeners run in addition to the default behavior, which is to run commands

#

If you want to influence how/when commands are run, you would do that in the base on_message event

languid dragon
#

Hi

languid dragon
#

Hlo

neon gull
neon gull
#

Or you can make an "application command" which is just the slash commands.
That looks like

import discord
from discord import app_commands
from discord.ext import commands

client = commands.Bot(...)

@app_commands.command(name='command', description='This is a command')
async def command(interaction: discord.Interaction, *args, **kwargs)
  ...

And then you've gotta restart your bot and either clear your cache or wait the hour (I think) for discord to recache app commands.

#

(I'm severely late to this conversation ik)

mint pecan
#

is ctx.send and ctx.channel.send the same?

golden portal
#

it used to, but not now, in hybrid, ctx.send would be that or interaction.response.send_message

toxic shadow
#

i am making a bot but the bot doesnt seem to reconise the command, but i reconises all the other ones. this is the code: @bot.command() async def website(ctx): embed = discord.Embed( title="Reputation Bot Website", description="Visit the official website for more information: [Reputation Bot Website](https://swiftly-fast.github.io/Reputation-Bot/)", color=discord.Color.blue() ) await ctx.send(embed=embed)

#

anyone know whats wrong with it?

golden portal
golden portal
#

this is in your main file?

toxic shadow
#

Yes

golden portal
#

show the whole file

#

!paste

unkempt canyonBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

toxic shadow
#

K give me a sec

#

I am eating so I'll be 2 mins

rare hollow
#

yo wsg anyone down to help me with this?

#

Idk what to do ive tried everything its annoying

rare hollow
toxic shadow
toxic shadow
#

i clicked download

#

but what do i do with the file

golden portal
#

copy the url and post it here, not download it

toxic shadow
golden portal
rare hollow
toxic shadow
rare hollow
#

always works for me

toxic shadow
#

there is no point

#

i won't

rare hollow
#

alr do as u please

golden portal
toxic shadow
#

i eill try this:

async def website(ctx):
    embed = discord.Embed(
        title="Reputation Bot Website",
        description="Visit the official website for more information: [Reputation Bot Website](https://swiftly-fast.github.io/Reputation-Bot/)",
        color=discord.Color.blue()
    )
    await ctx.send(embed=embed)```
#

and i got this:
2024-09-30 07:48:36 ERROR discord.ext.commands.bot Ignoring exception in command None discord.ext.commands.errors.CommandNotFound: Command "website" is not found

golden portal
#

send the full code again?

toxic shadow
golden portal
#

the pasted code looks incomplete

toxic shadow
#

It's BC I am on my phone and not my laptop so it ain't like properly formated

#

Does it change if I am doing this locally? On python3 ???

golden portal
#

nope, your error is not matching your pasted code so, probably since you're not showing me the correct code you're using

toxic shadow
#

I am

#

I GTG when I come back I'll send it again on my laptop correctly

toxic shadow
#

I might have to re-set the terminal

scarlet tiger
#

Hey guys, is anyone here using GalaxyGate for a Discord bot? Is this a good service?

wanton current
#

There's better for cheaper elsewhere

#

Looking at the standard, eg. Hetzner has better for less than half the price

scarlet tiger
mint pecan
golden portal
mint pecan
golden portal
young dagger
#

Good practice?

f"**Moderator:** {self.bot.get_user(infraction.get('moderator_id')) or 
                                  await self.bot.fetch_user(infraction.get('moderator_id')) or 'Unknown'}\n"

Tries to get the user from the cache first, If not found it fetches the user from Discord, If both methods fail it will fallback to Unknown.

#

To avoid making unnecessary Discord API calls if the moderator is already cached as a member in the server

wanton current
#

this is pretty common, usually called "getch" (get + fetch)

#

could probably make it into a function for prettier code

blissful crane
#

fetch_x raises discord.NotFound, not return None so or 'Unknown' is wrong

wanton current
#

true

young dagger
#

Because get_user will return None and relay on bot.fetch_user

blissful crane
#

yea, but as willi suggested. Making it a function is better

young dagger
blissful crane
#

just take this code, put it in an async function and use that function wherever you need

copper flume
#

does an autosharded bot set shards automatically?

#

my bot is in 1001 guilds with 1 shard (ID: 0)

wanton current
#

hence auto

copper flume
#

then why do I have 1 shard in 1000 guilds πŸ’€

wanton current
#

because sharding is only required at 2500 guilds

#

Autosharded bot uses the recommended shard count that discord sends when logging in via the gateway

copper flume
#

alr

wanton current
#

You can shard manually if you want your own amount of shards

fast osprey
#

Not really sure why you'd bother with sharding until discord tells you that you need to, but you do you

stark ingot
#

Most people set it up around 2000-2250 guilds. Other before then it can actually cause performance decreases.

slate swan
#

Discord recommends you the number of shards you should use if you hit the /gateway/bot endpoint

#

(which is what AutoShardedBot uses iirc

neon gull
#

Just change that to def website(ctx): and you’ll be all set

#

Just one of those times where you’re typing so fast you don’t realize what you did

neon gull
wanton current
#

🀨

neon gull
#

Not discord TOS just a companies TOS

fast osprey
#

Which by extension breaks discord tos

stark ingot
neon gull
neon gull
clear elm
#

anyone know how to make roblox-discord activity tracking

fast osprey
stark ingot
#

The only way to increase your limits is by getting approved by support after your bot reaches 150,000 guilds

slate swan
#

And even then, it's the global rate limit only

fast osprey
#

Also doesnt apply to bucket level rate limits

#

Which are completely separate

slate swan
#

how to go about making a vanity roles bot

#

like checks for /keyword in bio or status

fast osprey
#

You're going to have to be a bit more specific on the flow you want

slate swan
#

Anyone wanna make a cool discord bot with me I have all the resources

sick birch
unkempt canyonBOT
#

discord.on_presence_update(before, after)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Member) updates their presence.

This is called when one or more of the following things change:

β€’ status

β€’ activity

This requires [`Intents.presences`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Intents.presences) and [`Intents.members`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Intents.members) to be enabled...
sick birch
#

this event tells you when a user changes their status

slate swan
sick birch
stark ingot
#

I dont think user bios are exposed to the API

fast osprey
#

They aren't, by design

stark ingot
#

like checks for /keyword in bio or status
Probably to prevent this exact use case.

fast osprey
#

The public reason is for privacy concerns, they don't want bots scraping this as people put demographic info in there

inner copper
#

someone help me out im creating a bot but having trouble making my bot send a dm message

#

from what i understand this await member.send(f"You have been kicked from {ctx.guild.name}. Reason: {reason}") should send a dm message but instead it send it directly in my server

frigid stratus
fast osprey
#

You also should not be dming people who did not consent and ask to be contacted

vocal plover
#

I can't see an issue with DMing people from a bot as a result of moderation actions, it's quite reasonable, I've never seen anyone have an issue with it, and if they do maybe they should consider not breaking the server's rules

fast osprey
#

It's quite literally against the developer policy, whether you personally agree with it or not

  1. Do not contact users on Discord without their explicit permission.
#

Breaking your server rules isn't grounds for in turn breaking the developer policy. Just kick them, nobody is saying they need to be messaged. If they're worth an explanation, a human can contact them and explain it to them

vocal plover
# fast osprey Breaking your server rules isn't grounds for in turn breaking the developer poli...

It's done by every large server - and most small servers for that matter, we wouldn't be able to operate without doing it. It's something Discord clearly has no issue with as they've verified countless bots whose primary purpose is moderation with this as a key feature. If we were to DM members manually we'd open ourselves up to the sort of harassment that we get through modmail threads, only they'd know exactly who we are. It's evident that you don't have experience moderating large servers, so I suggest you don't speak without thinking when it comes to things you don't know about. You should also read the rules you quote before sending condescending messages about them, because they quite clearly state "not directly related to maintaining or improving an Application's functionality," and quite clearly this behaviour improves the functionality of a moderation bot.

inner copper
#

does that go against TOS

inner copper
young dagger
#

No you are good

#

We use Discord bots so we can automate some of the moderation

fast osprey
#

Just because people do X does not mean X is compliant with the policy

inner copper
#

well im asking if its okay or not

fast osprey
#

The policy also does not make exceptions in those cases. It says not to contact people who did not explicitly ask you to. It doesn't say "oh nvm you can do that whenever you want if you also kicked them"

#

Either get their approval, send the message in the guild where their notification settings are respected, or don't say anything

vocal plover
# fast osprey The policy also does not make exceptions in those cases. It says not to contact ...

I suggest you stop misleading people, or as I like to call it "lying when you've already been corrected":

Do not contact users on Discord without their explicit permission. This includes frequently sending unsolicited direct messages and/or sending direct messages not directly related to maintaining or improving an Application's functionality.
In the case of a moderation bot, sending a DM following a punishment is categorically "directly related to maintaining or improving an Application's functionality." This is not something that anyone but you finds controversial at all. It's not something Discord doesn't want bots to do, indeed platform moderation - something they already provide limited tools for, and rely heavily on external applications for - would be worse without it. It is not within Discord's interests to disallow that behaviour, just as it is not within their interests to actually take action against client mods (and those actually are against the ToS unlike this).

fast osprey
#

You can't just pick what you want and say that's the functionality, or that could be applied to justify dming anyone at any point you want if that's the "functionality"

#

It's obnoxious, it violates my notification settings, and it's not required for the bot to actually perform the meaningfully functional operation

#

It also costs nothing to be upfront with users and get their consent

#

Also if you want to rules lawyer, that clause is in a sentence that starts with "this includes". It does not override the first sentence

young dagger
vocal plover
#

You can't just pick what you want and say that's the functionality
Yes, you can, that's exactly what you do, that's literally what creating your own bot is, nobody else is deciding your functionality.

It's obnoxious
First time I've heard that opinion, so I don't believe it's very widely held.

it violates my notification settings
Block it. Turn off DMs for the server. Those are the settings that stop it DMing you, notification settings don't block DMs and never have, if they did this wuldn't be a conversation we're having.

and it's not required for the bot to actually perform the meaningfully functional operation
Yes, it absolutely is. We handle several hundred moderation cases per day, many of these are automated, we don't hev the resources (not inclination, I will elaborate further shortly) to manually contact every use to inform them about these, and if they're not informed the punishment is functionally useless because they do not know not to continue. The reason I alluded to earlier why we don't want to contact them by hand is that when moderators manually interact it opens them up to targeted abuse from the user, something that's largely avoided by the anonymity of a moderation bot. I am not going to put my staff team in a position to receive a greater amount of abuse because one person doesn't like that they haven't found the server setting to stop people sending them DMs.

It also costs nothing to be upfront with users and get their consent
In money, sure. In retention, asking users to select stuff like that when they join a server dramatically reduces the retention rates of members. People join servers for the server, not to click through menus and options. It's widely accepted that moderation bots will DM you in this way, and effective moderation is not something that's optional or which we get a choice in. We are required to moderate our servers in accordance with Discord's policy, and we cannot do that without effective tooling. You might get away with it on a server of a hundred people, but I'm running a server of over 550k, efficiency and automation of this sort is non negotiable for the server to effectively function.

inner copper
fast osprey
#

I'm not going to argue with y'all on very clear language lol. Pointing that you don't like it doesn't change the lettering of the policy. It says not to contact people who did not give you explicit permission to do so. The sentence after it does not change that

inner copper
#

im not arguing im seriously asking if its okay if i let them know on join

vocal plover
#

You're right the language is very clear:

fast osprey
vocal plover
#

Clear enough?

fast osprey
#

Read the beginning of that sentence.

#

What does "this includes" imply to you

#

"You can't bring fruit in here. This includes oranges that don't have stickers" -> I can bring any fruit with stickers

stark ingot
inner copper
#

well i think i should be okay knowing massive bots like mee6 and dyno send dms to people

fast osprey
#

Mee6 also got away with literally scamming people so

#

Up to you if you want to violate the developer policy just because others do shrug

viscid hornet
young dagger
inner copper
fast osprey
#

It was in response to them bringing up mee6 so how is that not relevant lol

fast osprey
#

If you want to put that in then go bonkers

young dagger
fast osprey
#

I'm drawing a parallel between "mee6 does it" and "it's okay for me to do"

#

And providing a very clear case where that line of thinking breaks down

inner copper
fast osprey
#

Pointing at people doing something doesnt change the lettering of the policy, not sure why y'all keep thinking it does

inner copper
#

heres what discord has to say

#

"Discord’s Terms of Service and privacy settings allow bots to send DMs to users, provided the users have allowed direct messages from server members in their privacy settings. If a user has disabled this option, the bot cannot bypass it to send messages, ensuring user privacy and preventing unsolicited DMs. This means that for a bot to DM users, they need to have their DM permissions enabled within the server they share with the bot. Discord does not provide a way to force DMs to users who have disabled this setting for privacy reasons​(
Discord Support
)​(
Discord Support
).

Make sure your bot respects these settings to avoid any issues with user privacy and compliance with Discord's guidelines."

fast osprey
#

There's also the fun disconnect that discord is great at not enforcing their policies consistently so take that with a grain of salt

young dagger
quick gust
#

"This includes frequently sending direct messages not directly related to maintaining or improving an Application's functionality"

this implies any feature that is not required for improving the functionality of the application should not be sending dms to the user.

The existence of "not directly related" implies that the opposite is not against their policy.

fast osprey
#

"This includes" directly elaborates on a subset. It does not impose a limitation at all on the preceding sentence

inner copper
#

alright thank you for the help fellas hope yall have a good day πŸ‘

quick gust
#

You're missing the part where they make the exception with "which is NOT DIRECTLY... "

fast osprey
#

I'm not missing that, because "this includes" by definition means it cannot limit the terms of the preceding sentence

meager rock
#

oh drama

fast osprey
#

"This is limited to" would be completely different

meager rock
#

Do not contact users on Discord without their explicit permission. This includes fremdently sending unsolicited direct messages and/or sending direct messages that are not directly related to maintaining or improving an Application's functionality pithink hope this makes it easier to understand

young dagger
fast osprey
#

I never said anything about "acceptable". I'm pointing out the terms of the policy, which are vastly more relevant to this server's rules than what discord "accepts"

uneven agate
tough rain
#

Is it possible using python requests to listen for any dms to your own account? instead of a bot

meager rock
tough rain
fast osprey
#

You can't use requests to "listen" for anything

meager rock
tough rain
tough rain
fast osprey
#

and really I don't think it's the right tree to bark up for "theoretically" violating server rules lol

tough rain
#

yea good idea, thanks

brazen raft
#

We're arguing for meaning in implicit exclusion. You're arguing for meaning in potentially confusing/irrelevant/detached wording

fast osprey
#

If they wanted to list an exception, they have very clear wording to do so (and use that wording elsewhere in their policy)

vocal plover
#

They did list it clearly, you're just incapable of understanding what you're quoting apparently.

fast osprey
#

They didn't. They have a consistent way of identifying exclusions. They chose not to use it here

#

Anywhere else you read in either the policy or tos where there is an exclusion to a set, they do not use "this includes"

#

This is ultimately a fruitless conversation between people who are most likely not lawyers, so interpret as you will.

The funny thing is that entire ambiguity is bypassed by just having the decency to ask your users before forcing things down their throat, and that's what this whole argument is built on

vocal plover
#

having the decency to ask your users before forcing things down their throat
I hope you know how self-righteous you sound. If someone in my server decides to break the rules then I hardly think that sending them a concise message explaining that they have been warned is "indecent", compared to their own rule breaking behaviour. I can only assume you frequently get punished if it bothers you that much, maybe you'd be better off if you didn't do that, and then mod bots wouldn't DM you πŸ™ƒ

fast osprey
#

I don't. I just report any bot that dms me without my consent, because that's what the policy encourages

vocal plover
#

And nothing happens. Funny that.

#

You just seem to have a lack of understanding of how the platform actually functions

fast osprey
#

The thing being argued here is taking away control from users on things affecting them and only them, and it's that important to you to strip people of that option

vocal plover
#

I'm not arguing for or pushing for that option to be stripped, and indeed users can prevent that with a platform provided option which cannot be bypassed. There is an option to not allow DMs not from friends, which solves the issue of bots DMing you, this is something that you and other users are free to do. Do not misrepresent my stance on this, that's not very decent of you.

fast osprey
#

The default is opt out. The onus is not on users to opt out of being contacted by bots.

vocal plover
#

And for most things I would agree, but there are clear cases where it makes sense to DM the user if they have DMs open. Moderation is one of those cases, is a core part of mod bots' functionality, and therefore by interpretation of more or less everyone but you is fine according to "directly related to maintaining or improving an Application's functionality."

fast osprey
#

Which is, again, an example subset included in the umbrella of that rule and not an exclusion

vocal plover
#

If you don't think it's decent to send users a DM in that case you clearly have no experience dealing with large communities, moderation is already hard and we don't need our lives to be made harder in this way. Volunteer moderation using mod bots is how the platform functions because Discord's own level of moderation is minimal.

fast osprey
#

I don't know how else to describe what the words "this includes" means

#

I don't think it's decent to refuse to give users the option to opt in

vocal plover
#

And I lack any way to explain in simple English how the following words are a pretty clear callout to a case where the rule doesn't apply

fast osprey
#

Or at minimum be upfront about what you are going to do

vocal plover
#

Opting in to being punished? Stop deluding yourself, that makes no sense

fast osprey
#

Being dmd isn't a punishment wut

#

Nobody is stopping you from moderating

vocal plover
#

How are you expecting users to be given warnings?

fast osprey
#

Tag them in the server and abide to their notification settings, or have a human explain it to them

quick gust
#

"I broke this rule but how dare u privately contact me to warn me about it without my permission"

vocal plover
# fast osprey Tag them in the server and abide to their notification settings, or have a human...

Per my previous message

The reason I alluded to earlier why we don't want to contact them by hand is that when moderators manually interact it opens them up to targeted abuse from the user, something that's largely avoided by the anonymity of a moderation bot. I am not going to put my staff team in a position to receive a greater amount of abuse because one person doesn't like that they haven't found the server setting to stop people sending them DMs.
I also have no interest in discussing people's punishments in public in the server, that creates needless drama and further increases the moderation burden.

fast osprey
#

The mechanism for a bot to contact a user is via their shared server, unless they have consented to being contacted. There are not magical exceptions to this based on things you personally believe are important enough to override their power to choose how they get notified and what the defaults as such are

#

It's literally just asking them for consent, that's it

vocal plover
# fast osprey It's literally just asking them for consent, that's it

How do you expect that to be done, exactly? How do you expect that to result in an effective moderation system? If we ask on join "do you wish to be DMed about warnings" then naturally, anyone likely to get one is going to answer "no", that's not an acceptable situation for a moderation environment. Regardless of what pedantic way you wish to misinterpret the developer terms, the idea that you can just have users cooperate with regards to their own punishments is laughably stupid. Volunteer moderation is a core part of platforms like Discord, because there's no way they can afford to do that in-house, so shooting those people in the foot to spite advertising bots is ridiculous.

fast osprey
#

You are again misrepresenting my argument. At no point have I advocated for getting in the way of "punishments". Sending a dm is not a punishment. If the user doesnt consent to being dmd, which they can implicitly already do, how you choose to respond to that is entirely in your power. Let them in, kick them out, I don't care

#

You lose nothing by being upfront about what your bot does unless you are maliciously hiding that behavior from your users

vocal plover
#

Sending a dm is not a punishment.
I can pick countless moderators who will disagree with you on this. Once again, you evidently have no experience in this area so I would refrain from saying things that are wrong and make you look silly without basis.

fast osprey
#

I do have experience. I just don't feel the need to hide what I'm doing and avoid getting consent from my users. To assume I don't have experience just because I don't agree with you is entirely uncharitable and not in good faith

#

If I am introducing users into an environment where the default understandings are not consistent with common defaults (they don't get dm'd by bots they haven't talked to), I spell that out for them and get their acknowledgment. The only reasons not to do so are either laziness or an active desire to withhold information, both of which are "silly without basis"

vocal plover
#

The only reasons not to do so are either laziness or an active desire to withhold information
You accuse me of saying things in bad faith and then ignore reasons I've given which vary from the two reasons you've selected to make me look bad. How ironic.

not consistent with common defaults
Not sure which magical made up universe you're living in, but the common default for public servers is that bots will DM you for punishments, this is hardly a subversion of a user's expectations, and reinforces my view that you have no experience in the area, because even if you did not personally do this there is no way you could possibly have been involved much if you're not aware that this is common across most servers.

fast osprey
#

Something being common is not equivalent to it being user-friendly or consistent with policy. This is a repeated thing you keep parroting like it matters

#

What is common is spelling things out for users and having them consent to it when they enter into a server. What you are arguing against so vehemently is a single line saying that they will be contacted by the bot. That's what is so important to you to not do.

#

You can continue attacking me, and your presumed strawman that you think I am, and all it's doing is making you look ridiculous that you're doubling down to avoid writing one line in a framework that presumably already exists (since you're such a talented and experienced community moderator, surely you have that yes?)

vocal plover
#

Something being common is not equivalent to it being user-friendly or consistent with policy. This is a repeated thing you keep parroting like it matters
Frankly speaking, punishments are not supposed to be user friendly, they are a consequence of a user breaking rules, user friendliness is consequently not my top priority in the cases my bots are DMing people. I keep repeating it like it matters because it does matter, even if it goes against the policy (which I don't believe it does, but alas the interpretation debate is unlikely to be resolved unless you corner a T&S operative and get them to confirm it one way or another) that doesn't mean it's bad. Lots of things go against lots of policies and are not bad things; BetterDiscord and Vencord go against Discord's policy, yet they do nothing, because the majority of people use them to make their experience on the platform better, which increases user count and retention for Discord. This piece of policy was quite obviously written with the intent of stopping the likes of MEE6 sending advertising and crypto DMs to users (though Discord, for whatever reason, seems reluctant to do anything to MEE6 no matter how many policies they violate), they are not to stop reasonable use cases like DMs upon moderation actions, which is why they have never chosen to take action on bots that do that.

to avoid writing one line in a framework
I hardly think it matters whether I add "a bot will DM you when you receive a punishment" in a Google doc where our policy lives, we know full well that nobody reads it anyway, it's there to point to when people do things against the rules to justify the action we take for rules lawyers. Adding a line to it, as I'm sure you can appreciate, will not materially affect anything with regards to users consenting or being informed. If it makes you happy I'll add it as soon as I get home and have my Google account logged in, but I fail to see how it'll change anything.

P.S. I've been sharing this conversation with other moderators I know to get their opinions and to make sure that I'm not saying anything that's ludicrous or misrepresents what most large servers do, and while you - as the sole person I've met who is incredibly angry that bots would dare to DM you - may believe I look ridiculous for arguing my side, it would appear that I don't to most reasonable people.

quasi frigate
#

hey can you make a bots prefix an emoji?

#

i would test it but i dont want to πŸ’…

sick birch
#

i dont see why not

slate swan
#

it's text like anything else, so yes it will work

blazing beacon
#

ww4 here okay-

timber dragon
#

True

golden portal
#

i mean it's your server though

hasty pike
golden portal
#

413 means payload is too large, perhaps you may need to increase your server's upload size?

cerulean folio
#

hi, my very old bot now doesn't get online nor gets in my server after i invited it, is there any updates that broke old bots or am i doing something wrong?

chrome shard
#

Hey guys I'm trying to get help with something. I'm using AllTalk in SillyTavern Launcher for TTS on an AI chatbot. The TTS has trouble handling punctuation. I found this script in the AllTalk folder that adjusts the punctuation by doing things like replacing multiple periods with a single period. Can it be adjusted to simply remove all punctuation?

# Replace multiple exclamation marks, question marks, or other punctuation with a single instance cleaned_part = re.sub(r"([!?.\u3002\uFF1F\uFF01\uFF0C])\1+", r"\1", part)

Here's the whole script I'm looking at: https://paste.pythondiscord.com/AKQA

#

Also sorry if this is the wrong help channel. I'm not sure where to categorize this.

stark ingot
stark ingot
cerulean folio
slate swan
#

is that your entire post request?

livid hare
fast osprey
#

Might not wanna broadcast to the world that you're breaking tos on the platform you're breaking tos on

hasty pike
#

Bro is supporting and opposing him at the same time

hasty pike
slate swan
#

If it's complicated, why not use an API wrapper

livid hare
#

who wants to break jst breaks

#

nobody wants to be just a dev

fast osprey
quick gust
mint pecan
#

how can i use the bot's mention as the prefix?

slate swan
#

!d discord.ext.commands.when_mentioned_or

unkempt canyonBOT
#

discord.ext.commands.when_mentioned_or(*prefixes)```
A callable that implements when mentioned or other prefixes provided.

These are meant to be passed into the [`Bot.command_prefix`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Bot.command_prefix) attribute.

Example

```py
bot = commands.Bot(command_prefix=commands.when_mentioned_or('!'))
```...
slate swan
#

!d discord.ext.commands.when_mentioned

unkempt canyonBOT
#

discord.ext.commands.when_mentioned(bot, msg, /)```
A callable that implements a command prefix equivalent to being mentioned.

These are meant to be passed into the [`Bot.command_prefix`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Bot.command_prefix) attribute.

> Changed in version 2\.0: `bot` and `msg` parameters are now positional\-only.
warm stirrup
#

almost cried rn lmfao, i went to add a check if the inputed args are correct before the command can move on with an if statement, instead of putting and between every statement i put in or and the command wouldnt continue for the life of me πŸ’€

#

spent 2 hours on it :)

slate swan
#

Happens, i also sometimes get that lmfao

mint pecan
#

why is there no "+ add app" button on my bot bio?

hasty pike
#

My bad misunderstood

slate swan
#

How many guilds is your bot in?

hasty pike
slate swan
#

How many shards do you have?

hasty pike
#

My first time using verified bot

slate swan
#

It's max 2.5k guilds per shard

#

Ideally between 2k and 2.2k per shard

hasty pike
#

so if i use commanda.AutoShardedBot and put shard_count=5

#

That's enough?

#

Or there will be more things i need to do?

slate swan
#

Just let it create the shards automatically

#

So that you don't need to always set the shards yourself

#

Just leave it empty, discord.py will request the endpoint of gateway bot to know the ideal number of shards you bot should have and spawn shards accordingly

#

Remove shard_count and let discord.py fetch the recommended shard counter from discord

slate swan
#

It'll likely spawn 4 shards

hasty pike
#

@slate swan apart from sharding i can use everything same as it is or there be any differences?

slate swan
#

all the same

hasty pike
#

Ahh thanks

slate swan
#

a shard is just a connection

hasty pike
#

Spawned 6

slate swan
#

ah yeah mb it's 1k-1.2k recommended per shard

left wing
#

is there a demand for discord bot devs? cuz it's the only skill I'm rlly experienced with rn

slate swan
#

Go on fiverr/upwork for that

hasty pike
slate swan
#

Dead as in?

hasty pike
#

No one wants personal bot coded anymore

#

Discord user's reduces after pandemic ended

slate swan
#

Well the best chances are there, and I'd say there's still a few that do

slate swan
#

It always grows by millions, like over 25 millions more than the year before

fast osprey
#

Is there a demand? Yes. Is there money? No

hasty pike
#

Might get some extra pocket money

slate swan
#

Yeah definitely, who knows

#

There're still a few people that want a custom bot but have no knowledge to be fair

hasty pike
#

Creators spend alot

fast osprey
#

It's not 0, but the supply more than outweighs the demand. If you want to make money, bots aren't the play

vocal plover
slate swan
#

The thing is that creating now a profile probably won't be that much effective, and there's lots of people that have already done it and gotten reviews

hasty pike
slate swan
hasty pike
#

Just my opinion

#

But as they wish

slate swan
#

Well, they gotta host their custom bot as well - that's what these people often forget

#

Seen people who thought discord hosts the bots

hasty pike
vocal plover
#

if you're developing a bot for someone for $30 I hope it's only taking you under an hour to make the whole thing or you're severely underselling your work

slate swan
#

Honestly the price for developing a bot cannot really be said before knowing what people want

#

You may be able offer some bots that have x features that are already done, and $30 for these can be quite a lot or the opposite depending on what it does

fast osprey
#

It's a race to the bottom, as people who buy these bots can't discern quality, and some kid on fiverr will say they'll do it for six lollipops and a Fortnite skin

slate swan
#

Underrated work to be fair

left wing
#

I just wanna get paid

hasty pike
hasty pike
hasty pike
left wing
#

Bro I'd give a decent amount of effort for just 5 dollars

#

I live in a 3rd world country so I can basically pay my gym membership with that 5 dollars

left wing
#

My parents said they can't pay my membership anymore 😭

#

That's why I want to earn some cash online

hasty pike
#

Wanna work with me?

#

Not sure what i can pay but you'd get to learn

left wing
#

Id love to man

hasty pike
#

Hop in

left wing
#

Aight

slate swan
spring flax
#

If I can only host one bot on my hosting server is it bad to try and condense multiple custom bots (each for one server) into one bot and check the guild id before doing commands or anything for each server?

slate swan
#

Technically not, should eventually reconsider your hosting provider though

spring flax
#

Yeah I’m trying to not spend money on them but hopefully later

hasty pike
slate swan
#

Find it pretty sad tbh lmao

fast osprey
#

How would your host know how many processes you're running, or care?

slate swan
#

Probably because it's one of those hosts that fetch your repo or you post the code and have that one process running or something similar

vocal plover
#

the host cold easily use setrlimit() to limit threads, but that would be extremely strange, since d.py/forks use a thread per shard in addition to the main one, so they'd just be prohibiting sharding essentially

fast osprey
#

Yeah if your host is actively being hostile towards what you're trying to accomplish, you're probably getting scammed by a "free" host. That money has to come from somewhere, and in this case it's probably coming from your sanity

vocal plover
#

or worse, your data

#

honestly with a host that did that I'd 100% expect them to be running it to collect tokens and then use them for malicious purposes

slate swan
spring flax
#

Is it easy process to make a bot run as a docket container?

#

Docker*

amber thorn
#

How do I make a bot like this python bot?

fast osprey
#

what functionality are you trying to make that you can't?

tender bobcat
#

(?

#

Why you think you are the only one

hasty pike
#

Many bot has this features

#

And they've been using it since few years

shrewd apex
#

what does an image logger do? record images sent by users in another channel?

#

hmm not sure about the exact use cases might be a bit sensitive here and there, but a cool project regardless

#

noice

hasty pike
#

I would like to see how you implemented it

#

You said you can share code i said I'd love to see

#

Believe me what i write is more messy

#

😭

young dagger
#

Can I see it?

cunning cedar
#
@bot.event
async def on_messge(message):
    msg = message.content.lower()
    word = 'test'

    if word in msg:
        await channel.send("testy")
``` im new to python bot development and if i type test it wont send back testy
fast osprey
#

Do you have the message content intent?

cunning cedar
fast osprey
#

That's not message_content

cunning cedar
#

oh uh

#

idk then

#

is there like a python docs google.com isn't really helping me today 😦

fast osprey
#

You need to turn message_content on if you want message content ya

cunning cedar
#

anyway how? is it intents.message_content = True?

fast osprey
#

yup

cunning cedar
# fast osprey yup

nope

intents = discord.Intents.default()
intents.messages = True
intents.message_content = True

@bot.event
async def on_messge(message):
    msg = message.content.lower()
    word = "a"

    if word in msg:
        await channel.send("testy")
fast osprey
#

That isn't what you just typed

cunning cedar
#

with intents. it gives me an error

#

so i removed it

fast osprey
#

What's the error?

cunning cedar
#

enable the privileged intents within your application's page

fast osprey
#

Then you need to do that

cunning cedar
#

man i just wanna code i hate config

#

should i re-add bot?

fast osprey
#

Nah

cunning cedar
#

ain't no way

#

i didn't giv emy bot administrator

#

still doesn't work

#

no errors

fast osprey
#

Don't give your bot admin

#

nothing to do with this error

#

Make sure you save after that toggle

cunning cedar
#

yeah i saved changes turned bot on typed a no response

fast osprey
#

What is your code now?

cunning cedar
#

same as before

cunning cedar
#

i only changed that

fast osprey
#

So no error?

cunning cedar
#

late response mb

pure basin
#

see if it will print it or not

#

also shouldn't it be message.channel.send?

cunning cedar
#

im new but gtg

cunning cedar
slate swan
#

Does anyone need help w a bot

#

I’m an expert

unreal pilot
#

yo does anyone know how to work with integration_types in discord.py? I am trying to make my discord bot an application that is user installable, not just server installable

golden portal
#

!d discord.app_commands.user_install

unkempt canyonBOT
#

@discord.app_commands.user_install(func=None)```
A decorator that indicates this command should be installed for users.

This is **not** implemented as a [`check()`](https://discordpy.readthedocs.io/en/latest/interactions/api.html#discord.app_commands.check), and is instead verified by Discord server side.

Due to a Discord limitation, this decorator does nothing in subcommands and is ignored.

New in version 2\.4\.

Examples...
mint pecan
#

if i want to add checks to a hybrid command do i have to use both app_commands and commands?
example:

    @commands.has_permissions(ban_members=True)
    @app_commands.checks.has_permissions(ban_members=True)
hasty pike
#

How do i check if user is mod or not?

slate swan
#

Check the permissions of the member

timber dragon
timber dragon
# hasty pike How do i check if user is mod or not?

You could look for a role or a certain set of permissions:

# Define permissions for a "mod"
usual_mod_perms = discord.Permissions(
    moderate_members=True,
    kick_members=True,
    ...
)

member: discord.Member = ...
# Check whether the member has the same or more permissions than specified above
is_mod = member.guild_permissions.is_superset(usual_mod_perms)
cunning cedar
# pure basin try printing msg
@bot.event
async def on_messge(message):
    msg = message.content.lower()
    word = "a"

    if word in msg:
        print("debug")
        message.channel.send("yo")
``` no debug message, should i send all code? i use vsc
fast osprey
#

What is the message content you're getting?

mint pecan
#

does commands have a decorator that i can check if the author is the server's owner (not bot's owner)?

fast osprey
#

No, you'd have to check that yourself

young dagger
#

Do I need both import os and from dotenv import load_dotenv to import env from a file?

slate swan
#

Well you get the env variables with os.getenv("...") so yes

unreal pilot
#

Didnt

mint pecan
#

what's the difference between commands.<error> and commands.errors.<error>?

blissful crane
#

no diff, commands/errors.py contains the error classes, and commands/__init__.py imports those classes

cunning cedar
#

mhm

#

spending 13 hours a day looking at my pc is nice but goes fast

slate swan
#

I have a working bot and the programming does not have any problems, but when I run it it works fine for 5 minutes and then turns off and does not interact and does not show me any errors in the programming program.

slate swan
pure basin
#

on_message not on_messge

cunning cedar
#

god i hate google sometimes

slate swan
cunning cedar
#
@bot.event
async def on_message(message):
    msg = message.content.lower()
    word = "a"

    if word in msg:
        print("debug")
        message.channel.send("yo")
``` it sends debug console says
C:\Users\slime\OneDrive\Desktop\serverping\bot.py:38: RuntimeWarning: coroutine 'Messageable.send' was never awaited
  message.channel.send("yo")
pure basin
pure basin
slate swan
pure basin
#

how long

cunning cedar
#

it works

#

now

#

time to learn python

slate swan
cunning cedar
#

i swear 95% dc users are 10 year olds and easily get hacked

#

like i joined a server with 5k ppl and it said "authorise app to join this"

slate swan
#

This line checks the time remaining to open a new ticket after the last open ticket.