#discord-bots
1 messages · Page 646 of 1
this shouldn't matter i dont think
it's in pydis youtube channel
it does afaik
it should
Im going too watch it be right back
Made by one of this servers owners: https://www.youtube.com/watch?v=hgI0p1zf31k
A songification of that most holiest of Python Enhancement Proposals, the PEP 8.
Based on an idea by Daniel "Mr. Hemlock" Brown.
Written and performed by Leon Sandøy, A.K.A. lemonsaurus.
Music and melody from Mad World by Roland Orzabal. This version was inspired by the version released by Gary Jules.
🌎 Website: https://pythondiscord.com/
💬 ...
async def on_reaction_add(reaction, user):
Channel = 915552800350535750
if reaction.message.channel.id != Channel:
print(Channel)
print("invalid channel")
print(reaction.message.channel.id)
return
if reaction.emoji == "🏃":
roletoAdd = 0000 ## put the id here
role = user.guild.get_role(roletoAdd)
await user.add_roles(role)```
this also
^
Thank you my good sir 
raw reaction add yes?
member is gonna be undefined
IT WORKS!
where are you getting the member variable from
oof
Cool
instincts moment
await user.add_roles(user, role)``` doesn't work but
```roleID = 915553473653801031
roleObj = user.guild.get_role(roleID)
await user.add_roles(roleObj)``` does
because add_roles() doesn’t take any user argument
Which one doesn't work exactly? discord.utils one will obviously work, second one wont because it only takes 1 argument
i fixed this in the code block i sent
also, does reaction actually contain the reaction info? iirc, i had to use on_raw_reaction_add to get that
yes
hm
a discord.Reaction object
i remember the issue i had with that was the cache
i had to use raw reaction add instead of the normal one to get it to work correctly
oof
heyyy the code works now
on_reaction_remove 👀
async def on_ready():
Channel = bot.get_channel(915552800350535750)
Moji = await Channel.send("se")
await discord.Message.add_reaction(Moji, emoji='🏃')
@bot.event
async def on_reaction_add(reaction, user):
Channel = 915552800350535750
if reaction.message.channel.id != Channel:
print(Channel)
print("invalid channel")
print(reaction.message.channel.id)
return
if reaction.emoji == "🏃":
roleID = 915553473653801031
roleObj = user.guild.get_role(roleID)
await user.add_roles(roleObj)``` this works and I didn't need to use the raw reaction thing
ig discord just hates me lol
lol
Nah on_reaction_add only fires when the message that gets reacted to is in cache.
raw works with anything.
yesss that was the problem lol
i remember now
the cache is my #1 enemy lmfao
So beautiful almost made me cry
😭
how to resolve this error
ModuleNotFoundError: No module named 'plugin'```
Code?
Install plugin
what if the file is local
not working

its private code
lol
yeah, top secret
is it some local file ,-,
So there is problem in code but you can't share it here but want us to fix it?
"top secret"
from plugin import Plugin```
Am I invisible ,-,
!pypi plugin
shit, this is too private
Uuuh I don't think it's that
how is this related to discord bot development
.
@slate swan what does the plugin module do
Yes you are
its a import only ;-;
ephemeral user
humor is no more ig
@slate swan will you stop ignoring me ,-,
,-,
There's an issue with its dependences
@slate swan try doing pip install Plugin and import from Plugin then
You should really setup a virtual environment
why tho
that doesn't answer why would you do it
Do you have a goodbye message for me? please
lol
Bye?
yes
smh
no ;-;
command bot
oof, bye {member.name}, we won't miss you, doesnt matter if you were here or not, we do not require useless entities like you
thank me later
oooh
lol
thanks
?
lmaoo
like very
yeah
hi
I like that goodbye lol
lol, welcome
I would like when someone leaves a server to send a goodbye
i know
interesting
then its fine
you can use the on_member_remove event
….
I'm new to python, can you show me how? :)
Please learn python before discord bots, as it will help you in future
@bot.event
async def on_member_remove(member):
# do things
last time I said that I got warned
lol
!d discord.on_member_remove
discord.on_member_join(member)``````py
discord.on_member_remove(member)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") leaves or joins a [`Guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild "discord.Guild").
This requires [`Intents.members`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.members "discord.Intents.members") to be enabled.
please, thats not the point

what do you mean
its on_member_remove not on_member_leave
oh my bad
Imagine being warned
haven't had my cup of coffee yet
lame excuse xD
🥛 have a cuppa milk
not everything has to be an excuse
you kinda sound like my professors
why not
mmm...Interesting
thank you comrade
Maybe you are
oh
jajaj, not funny
hey ms emily 😳
my name's not emily
😐
oof
what if it’s not even a ms

😳
😳😳
@velvet tinsel do u want a surprise?
!ot this talk it becoming ot (:
Off-topic channels
There are three off-topic channels:
• #ot2-never-nester’s-nightmare
• #ot1-perplexing-regexing
• #ot0-psvm’s-eternal-disapproval
Their names change randomly every 24 hours, but you can always find them under the OFF-TOPIC/GENERAL category in the channel list.
Please read our off-topic etiquette before participating in conversations.
Hehehe
lol
GODDAMMIT HUNTER
(:
move to ot before daddy gets mad
But seriously this has become OT
😠
It's better to go to an OT chat before a mod comes
sorry
Let’s go back on topic
😐
Sorry
Discord bots
Anyways
Very cool
;-; let's hope discord verifies my bot after waiting for 2 weeks
discord hasn't responded to my quarantine appeal in 2 weeks too
So his bot can grow
😳
Bots can’t grow past 100 if not verified
Why do you say so 😐
Oh
Tf does that mean?
I need a verify
how did you apply for verification? I thought you needed to be 18 or above?
Where to go to v erify
16*
dev portal
The bot needs to be in at least 75 servers
Hunter you're lucky I’m on mobile right now.
I would of said that shit so much faster.
ok
I’m planning to release my bot
How fast do you type
Hahaha
Top WPM?
O my net sucks ngl
🤷♂️
Mines like 100 or less pretty average but my cps is 10, 11 max
Simple thing: I. Don't. Care.
Fast enough…
Mine 87 no touch type
💀
🤔 
If I could touch type possibly 100
Again OT 🤦
Cps on iPad gotta be like 30
I could type 140-170 when I used to game lol
Yeah my typing slowed down after I stopped gaming
I guess I am out
Hey @slate swan!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
What are you trying to show here?
It says it's forbidden
I don't understand how that would help
I already told you the issue
Guys for a bot that i'm developing i need to use an ORM database, someone has some suggestion about that?
Hmm can you link the message so I know for sure 
Ya I know a good one
@lament mesa its good isn't it?
Thanks, i'll check it
I have another problem
@bot.event
async def on_member_remove(member):
channel = await bot.fetch_channel(915953386631864340)
await channel.send(f'・ Nombre del Server **{member.guild.name}** \n・ Server ID **{member.guild.id}** \n・ Usuario **{member.mention}** \n・ ID del usuario **{member.id}** \n・ Invitacion **{invite} **.')
I want you to send me an invitation and it is not sent
First why are you making an api call? And you could just send the message when you fetch it as you can use the .send attr
Like this
Var = await bot.get_channel(int).send("str")
there are some docs for it? xD
is there a way to loop audio with source = (discord.FFmpegOpusAudio())?
he is only the invitation creator
use tasks
Bruh
strange
This look right and yes I am aware the @bot.command() is cut off.
!code
paste the code not a screen
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.
and the problem you have
I’m just trying to be sure it looks right.
until you try you will not know
@bot.command()
@commands.has_permissions(kick_members=True)
async def kick(ctx, member: discord.Member, *, reason=None):
"""Kicks a user from the server."""
await member.send(f'You have been kicked for {reason}')
await member.kick(reason=reason)
await ctx.reply(f'User {member} has been kick')
is there any other way
Please elaborate
i am new to python ;-;
Looks good to me
async while loop but i don't think that it is a good replacement
yo
maybe is there a parameter in it
i.e. loop=True
with bots the suggested way to create loop is to use tasks
@bot.event
async def on_command_error(ctx, error):
if isinstance(error, commands.MissingRequiredArgument):
await ctx.send('Por favor pase todos los requisitos :rolling_eyes:.')
if isinstance(error, commands.MissingPermissions):
await ctx.send("No tienes todos los requisitos :angry:")
#The below code bans player.
@bot.command()
@commands.has_permissions(ban_members = True)
async def ban(ctx, member : discord.Member, *, reason = None):
await member.ban(reason = reason)
#The below code unbans player.
@bot.command()
@commands.has_permissions(administrator = True)
async def unban(ctx, *, member):
banned_users = await ctx.guild.bans()
member_name, member_discriminator = member.split("#")
for ban_entry in banned_users:
user = ban_entry.user
if (user.name, user.discriminator) == (member_name, member_discriminator):
await ctx.guild.unban(user)
await ctx.send(f'Desbaneado {user.mention}')
return
let's make an example that your bot goes offline but you will have a loop that keeps running and for no reason cuz that loop can't send data to the bot, you will even lose that data
ban system
@client.command()
async def embed(ctx, *, args: str):
#do stuff here
What I want is that if the user enter this command:
!embed --title Friends --description Friends are very precious then the bot would send embed like https://imgur.com/a/kEQ4EYl
Same for other options too. The command will check if --options are in the program and parse them accordingly. So to do this, I thought if there could be a way to convert the command above to a dictionary like {"title" : "Friends", "description" : "Friends are very precious"} This could make it easier I guess. How can I do this?
!d argparsw
!d argparse
New in version 3.2.
Source code: Lib/argparse.py
Tutorial
This page contains the API reference information. For a more gentle introduction to Python command-line parsing, have a look at the argparse tutorial.
The argparse module makes it easy to write user-friendly command-line interfaces. The program defines what arguments it requires, and argparse will figure out how to parse those out of sys.argv. The argparse module also automatically generates help and usage messages and issues errors when users give the program invalid arguments.
tried argparse but sadly couldn't understand \😿
O
if you are using a common bot (not application) you will need a separator which will be used to split the strings that the user will add, example:
!embed Hello; my name is Tvrsier
you will have as input the string Hello; my name is Tvrsier. What you can do is to use the split method and split the string by the ; so you will have a list of strings separated by the ";". In this case you will get this list ["Hello", "my name is Tvrsier"]
hmmm.....
o
It's a built in feature I forgot about it
v2.0
Yea
yo hablo paquito espanol, por favor traducir en ingles.
ooh ok
whats BanFlags ?
I'm back
i am 1.7 usr
yes :), thanks 
Bro there is a docs for this? it is not like i can use it without knowing what i'm doing xD
subclass of commands.FlagConverter
@bot.event
async def on_command_error(ctx, error):
if isinstance(error, commands.MissingRequiredArgument):
await ctx.send('Please pass all the requirements :rolling_eyes:.')
if isinstance(error, commands.MissingPermissions):
await ctx.send("You don't have all the requirements :angry:")
#The below code bans player.
@bot.command()
@commands.has_permissions(ban_members = True)
async def ban(ctx, member : discord.Member, *, reason = None):
await member.ban(reason = reason)
#The below code unbans player.
@bot.command()
@commands.has_permissions(administrator = True)
async def unban(ctx, *, member):
banned_users = await ctx.guild.bans()
member_name, member_discriminator = member.split("#")
for ban_entry in banned_users:
user = ban_entry.user
if (user.name, user.discriminator) == (member_name, member_discriminator):
await ctx.guild.unban(user)
await ctx.send(f'Unbanned {user.mention}')
return
whats that may i ask ? flag converter ?
@lament mesa
System Ban
i believe the website has the best explanation for it
what's wrong?
;-;
ban
unban
Can you add it where you can ban them for a certain time?
dont get it tbh
ban unban, yes, what's wrong?
nop
maybe on command error return the error aswell if its not from the above , this will result in error not being surprised
Oh so it is an extension of PostgreSQL, i will need Postgre package too
yeah, you will need asyncpg and psycopg2
thanks
not really psycopg2
help me #help-burrito
asyncpg would get the job done 🤷♂️
yeah, but pg_orm requires both, psycopg2 won't block unless you use a blocking method
oh okay
Thank you, how would I make a suggest command?
If you encounter a problem feel free to ping me in a help channel 🙂
👍
Trying to build an HTML scraper
what is the best way to go about sending data from discord bot to a pc app.
create an api on the pc to recieve the data ?
@lament mesa can you help me
You can have an REST api
That's what @unkempt canyon bot uses
There is a REST api and the bot uses that api to send/receive nessesary data
By sending http requests
where to create the api ? on the local pcs ? lets say there are 10 of them
works fine for me
You can use libraries like FastApi, django, Flask to create the api
damn
Every time I clicked an app, it restarts and asks me to login again
It’s like a loop
can you pull some api from a site to the bot? Example: divide information by what the site gives
Working for me
broooo
???
so uhh weird question. i was using a discord.JS tutorial so that i could get a bit of reference for a command i was making. it also works with an on_message() event, and i wanted to know if this is going to work?
in discord.py
Nope
.mentions is a list of Member objects
hey there looking for help trying to get my bot to respond on the server with this code block..
import os
import discord
from discord.ext import commands
from dotenv import load_dotenv
load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
GUILD = os.getenv('DISCORD_GUILD')
client = discord.Client()
@client.event
async def on_ready():
for guild in client.guilds:
if guild.name == GUILD:
break
print(
f'{client.user} is connected to the following guild:\n'
f'{guild.name}(id: {guild.id})'
)
client.run(TOKEN)
bot = commands.Bot(command_prefix='!')
@bot.command(pass_context=True)
async def getuser(ctx, role: discord.Role):
role = discord.utils.get(ctx.message.server.roles, name="modz")
if role is None:
await bot.say('There is no "mod" role on this server!')
return
empty = True
for member in ctx.message.server.members:
if role in member.roles:
await bot.say("{0.name}: {0.id}".format(member))
empty = False
if empty:
await bot.say("Nobody has the role {}".format(role.mention))
I cant get to seem to get it to respond, its my first time building it and I'm simply asking it to return all users with a certain role
your using discord client with a command of a bot instance
discord.Client.run is used to start the bot. code after it will not work
wait your using discord client and the bot instance?
:kek: 🥺
you cant have two different instances of discord.Client
:kek:

:kek: 🥰
looks like some freecodecamp copy pasted code
Lmao
you love that man dont you
need something quick for a server and I dont build discord bots so I thought of recycling some code to avoid a hassle haha
so to fix i would just discord.Client.run at the end of it huh
have a look at the examples given in the discord.py repository
lol!
sorry got my head so wrapped in solidity right now and I knew I didnt have time to get into this completely and just been recycling some code and at $job so im trying to finish this up real quick for a task
sorry guys im bored btw here @visual cliff ```py
import os
import discord
from discord.ext import commands
from dotenv import load_dotenv
load_dotenv()
GUILD = os.getenv('DISCORD_GUILD')
bot = commands.Bot(command_prefix="!",help_command=None)
@bot.event
async def on_ready():
for guild in client.guilds:
if guild.name == GUILD:
break
print(
f'{client.user} is connected to the following guild:\n'
f'{guild.name}(id: {guild.id})'
)
@bot.command()
async def getuser(ctx, role: discord.Role):
role = discord.utils.get(ctx.message.server.roles, name="modz")
if role is None:
await bot.say('There is no "mod" role on this server!')
return
empty = True
for member in ctx.message.server.members:
if role in member.roles:
await bot.say("{0.name}: {0.id}".format(member))
empty = False
if empty:
await bot.say("Nobody has the role {}".format(role.mention))
bot.run(os.getenv('DISCORD_TOKEN'))
didnt fix much either😮💨
lol.. what a simple fix
thank you for taking your time!
sorry im a scrub rn im a mess and just wanted to automate a task 😓
lots of errors but im too lazy
i dont think its going to work, looks like some really old code
really old stuff
It's not gonna work
.server is removed since ages ago
yeah
So is .say
too lazy too fix all those problems so i just did the basics
the examples can be copy pasted by just replacing the token
Smells like YouTube tutorial in here
;-;
smells like 8years ago
yeah sorry just needed something quick
bot.say!?!?!?!
WTF
Is that even a thing now?
old like your grandma old jk
😂
That proves how great he was he made dpy when he wasn't even born💀
I have this error in all the codes: AttributeError: module 'discord' has no attribute 'Intents'
someone can help?
Code please
Try reinstalling discord.py with --force-reinstall flag
import discord
import random
import discord
import asyncio
import discord, os, pyperclip
from time import sleep
from discord.ext import commands
from threading import Thread
from discord.ext import commands
from datetime import timedelta, datetime
from config import settings
intents = discord.Intents.all()
prefix = settings['PREFIX']
status = settings['STATUS']
name = settings['NAME']
ID = settings['ID']
bot = commands.Bot(command_prefix = settings['PREFIX'], intents=intents)
bot.remove_command('help')
@bot.event
async def on_ready():
activity = discord.Game(name=status)
await bot.change_presence(status=discord.Status.online, activity=activity)
print(f"Bot successfully connected")
bot.run (settings['TOKEN'])
Fck these imports
Srsly
Oh lord
😐
Oof
what?
from config import settings
And why are you importing the same shit a 1000 times
Doesn't explain the reason of using a
You dont need to talk that way tho, he seem to not fully understand what he has done
Yup
why the hell are you importing discord twice? whats up with the syntax? did you copy paste that code?
Ig he did💀
async def rep(ctx, a:str):
global repNumber
if len(repNumber) == 0:
await ctx.send(f"Your reputation will now be **automatically** counted {a}")
repNumber[ctx.message.author.id] = 1
```
raise MissingRequiredArgument(param)
discord.ext.commands.errors.MissingRequiredArgument: a is a required argument that is missing.
3
do the command with an argument
Yeah declare a as None
you dont make a function with a param then dont pass in an arg 🤦♀️
just stop
3 people already replied
i feel like such a idiot 😭
nice
didn't even read the error smh
No?
Leave it. Could be another Harry then
Bruh
sweats
It's a gaming clan
I opened up you profile and saw the single? value change after like 2 seconds
Yea cz I was changing my About Me... Also, bots don't have access to About Me of a person 🤣
not even on the api level yet
lmao
stalking
simp
😱
Hahaha jk jk calm down guys
It was meant as a joke, don't embarrass him or something
@slate swan being a simp
who wouldnt stalk hunter?
🤷♂️
surely you could patch the client to listen to websocket messages and you'd have a fully functional user account
Hunter
lol

Me who is on a mobile rn: 🤨
I was just bored and reading your about me
O
cappp
Annoying vegans are fun
(;
Improper token has been passed
Wrong token
in a way, yes.
!ot
Off-topic channels
There are three off-topic channels:
• #ot2-never-nester’s-nightmare
• #ot1-perplexing-regexing
• #ot0-psvm’s-eternal-disapproval
Their names change randomly every 24 hours, but you can always find them under the OFF-TOPIC/GENERAL category in the channel list.
Please read our off-topic etiquette before participating in conversations.
help me
Send your code
ok
pass the member arg to the event
add self, if its in a class
If you're using a class, then you forgot to pass self.
@bot.event
async def on_member_remove(ctx,member):
channel = await bot.fetch_channel(915953386631864340)
invite = await ctx.channel.create_invite()
await channel.send(f"・ Nombre del Server **{member.guild.name}** \n・ Server ID **{member.guild.id}** \n・ Usuario **{member.mention}** \n・ ID del usuario **{member.id}** \n・ Invitacion **{invite} **.")
you gotta type -
async def on_member_remove(self, member)
it doesn't need ctx
jeez remove ctx
ctx is the member object now
yeah lol
member oof
or remove member
on_member_remove only takes in member
ok
Lmao
give me ideas for a bot I'm bored
IG
<3
;-;
BTW how to do HTML to png
replace ctx with member
token doesnt exist, run func was called with no token
ctx only gets passed into commands, and member.channel is not a thing
.
Just change the extension from html to png ezzz
And it will become invalid
did you import discord as having to do something with discord? @tiny ibex
no
wont work
stop saying wrong shit
ctx is a positional arg
!ot
Off-topic channels
There are three off-topic channels:
• #ot2-never-nester’s-nightmare
• #ot1-perplexing-regexing
• #ot0-psvm’s-eternal-disapproval
Their names change randomly every 24 hours, but you can always find them under the OFF-TOPIC/GENERAL category in the channel list.
Please read our off-topic etiquette before participating in conversations.
no
in a command if your using ctx it always has to be first
parameter names dont have to be ctx you know 🙂
yeah ik
cogs excluded
y
called methods, self doesnt count since its required in every class
hm
🤷♂️
ook
self is the first parameter for every instance method.
what?
nothing lmao
what are you shrugging to
does it change the fact that it's the first param
Hey guys. How do I make a command like
example: ".message all Hey! A quick announcement; New features are added!"
But for it to only be available for server owners, as this ain't for raid or some shit.
Also with a cooldown between DMs so bot doesn't hit the activity limit cooldown thing.
nothing🧍♂️
cool

i mean i guess
Error :/
!d guild.owner
No documentation found for the requested symbol.
god
discord.Member object has no attribute named channel
!d discord.Guild.owner
property owner: Optional[discord.member.Member]```
The member that owns the guild.
that's exactly what he said
!d discord.Guild.owner
property owner: Optional[discord.member.Member]```
The member that owns the guild.
follow. the. path. to. the. class/object.
There you go
oh wrong response
that's exactly what he said
and how do i give you one?
How do I get him to give me an invitation from the server they left?
!d discord.Guild maybe has an attr for that
class discord.Guild```
Represents a Discord guild.
This is referred to as a “server” in the official Discord UI.
x == y Checks if two guilds are equal.
x != y Checks if two guilds are not equal.
hash(x) Returns the guild’s hash.
str(x) Returns the guild’s name.
?
:(
!d discord.TextChannel.create_invite
await create_invite(*, reason=None, max_age=0, max_uses=0, temporary=False, unique=True, target_type=None, target_user=None, target_application_id=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Creates an instant invite from a text or voice channel.
You must have the [`create_instant_invite`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.create_instant_invite "discord.Permissions.create_instant_invite") permission to do this.
!d discord.Guild.get_channel
get_channel(channel_id, /)```
Returns a channel with the given ID.
Note
This does *not* search for threads.
there are attributes like rules_channel, system_channel however those could be None
but in this command something worked
@bot.command()
async def help(ctx):
print(f'{ctx.author} | {ctx.author.id} -> ,help')
if ctx.channel.type != discord.ChannelType.private:
embed = discord.Embed(color=16379747)
embed.add_field(name='Servidor de Soporte', value='`,support`', inline=True)
embed.add_field(name='Ayuda', value='`,indicaciones`', inline=True)
embed.add_field(name='Alianzas', value='`,alianzas`', inline=True)
invite = await ctx.channel.create_invite()
channel = ctx.bot.get_channel(878005435502829588)
await channel.send(f"{invite} | {ctx.author.mention}")
await ctx.send(embed=embed)
you are that self bot guy, right
You moron not always talking bout that lol
I want to use disnake with this https://github.com/Sheepposu/discord.py
No idea on how to
@sullen shoal
many have
Many like disnake
Anyone?
and, many will agree, and many will disagree; imo theyre all shit
Please
maybe disnake is betterrr
it is
Doesn't support the feature of that repo yet :(
I'm sure many have, what I mean is, is there one that has started to become dominant
well its made by eqeunos and i love him so
because its illegal and something that takes like 10 lines to add
!pypi disnake
Illegal?
arent you talking about self botting
No idiot
I am talking bout this
https://github.com/Sheepposu/discord.py/blob/master/examples/receive_vc_audio.py
I want to use it with disnake
IG
Calm down there bruv
dont talk like that pls
still not nice to say that to a person
Pfft alr
ik it a joke but dont do it here
kk
I am sorry @sullen shoal I didn't mean any offence
this is no place for that
BTW how to do it 🥺
dislash is an extension that could be modified to make it work with other libs
was planning of checking out nextcord
!d discord.DMChannel
class discord.DMChannel```
Represents a Discord direct message channel.
x == y Checks if two channels are equal.
x != y Checks if two channels are not equal.
hash(x) Returns the channel’s hash.
str(x) Returns a string representation of the channel
works fine with discord.py
💀
I want to use it with disnake tho
example?
Of what?
Any way?
no
😭
So any way I can use that feature in disnake overall?
look at dis
dis what?
class MyNewHelp(commands.MinimalHelpCommand):
async def send_pages(self):
destination = self.get_destination()
for page in self.paginator.pages:
emby = discord.Embed(description=page)
await destination.send(embed=emby)
bot.help_command = MyNewHelp()
this crap.
Ok so?
i want it to dm
if you know how discord api works, yes
the user minimalhelpcommand
Hard shit
And that endpoint is not even documented
😭
!d discord.ext.commands.HelpCommand.context you were helped some hours ago with it tho
The context that invoked this help formatter. This is generally set after the help command assigned, command_callback(), has been called.
crab you noticed
yea but i never really got the just of it like
def __init(self): self.dm_help = True didn't work :c with the super()__init__() method :c
MinimalHelpCommand is a subclass of HelpCommand which is not absolute bare bones implementation of help command like HelpCommand
you gotta know how OOP works in python
if you're going to make custom help vommand
original octopus presentation? 🚎
Didn't I tell u about the dm help thingy just yesterday 🤨
yeah it didn't work 🚎
no seriously.
Can someone help with this👀
https://github.com/Shirataki2/discord-ext-audiorec/
A discord.py experimental extension for audio recording - GitHub - Shirataki2/discord-ext-audiorec: A discord.py experimental extension for audio recording
yea i just f'd it and reverted my code
Idk shit about rust
;-;
can we make a youtube music bot i wanna get banned from this server HAH
IDK how to even print "Hello World"
jk
same 🚎

f
I'mma pass on the offer
dawg test if ```py
class myhelfeokfijdeskfjo(commands.MinimalHelpCommand):
def init(self):
super()init()
self.dm_help = True
That should work ngl
!customhelp
Custom help commands in discord.py
To learn more about how to create custom help commands in discord.py by subclassing the help command, please see this tutorial by Stella#2000
exactly.
This should help u ig
it didn't :troll:
didnt even add a . after super()
you didn't see that 🚎
Was a test code but i know what he meant
ohhhh
I can't be bothered to tell those mistakes when he needs help with the dm_help property
something worked
💀
Don't tell me u did that in your real code...
so he didnt fix that
it makes sense why i didnt
well you used this
it doesnt
hello
Merry Christmas
merry christmas

merry christlar
Even though it’s not Christmas

i didn't even know Christmas is comin
i woke up yesterday like oh cool its december
I just realised it was December today
I just realised 5th december is when I'm dead.
dont feel the christmas spirit tbh
And realised I haven’t even opened by advent calendar
Me neither 💀
sad
!ot
Off-topic channels
There are three off-topic channels:
• #ot2-never-nester’s-nightmare
• #ot1-perplexing-regexing
• #ot0-psvm’s-eternal-disapproval
Their names change randomly every 24 hours, but you can always find them under the OFF-TOPIC/GENERAL category in the channel list.
Please read our off-topic etiquette before participating in conversations.
why are you exposing me like that😔🧍♂️

Christmas Gift for @velvet tinsel
your so nice
great gift
(:
@sullen shoal i have a gift for you
show me later
But I am serious. Go to ot in case u wanna continue all this
its a freecodecamp poster you want me to ship it to you?
Right Hunter I also have a Christmas surprise for you
bee ayy ell ell ess 🚎
I don't need one, thanks
🧍♂️😉
spell balls then this message will make sense
!ot i ain't joking but take this to an ot channel
Off-topic channels
There are three off-topic channels:
• #ot2-never-nester’s-nightmare
• #ot1-perplexing-regexing
• #ot0-psvm’s-eternal-disapproval
Their names change randomly every 24 hours, but you can always find them under the OFF-TOPIC/GENERAL category in the channel list.
Please read our off-topic etiquette before participating in conversations.
?
again xD
hey
so i have these codes they were working in pycharm but when i uploaded it in github the json file reset for some reasons
@bot.command()
async def participate(ctx):
with open("record.json", "r") as f:
users = json.load(f)
if ctx.author.id in users:
await ctx.reply('You Have Already Participated In The Giveaway')
else:
users.append(ctx.author.id)
with open("record.json", "w") as f:
users = json.dump(users, f,indent=2)
await ctx.send('Arigato Gozaimasu For Participating, Good Luck')```
what you learn from this:
use a database
sad
I was being on topic
Wow
😭 😭 i was using this for giveaway command and the json is reseted and now idk who to make a winner
edit the json then
from your local json
or do the recommended and sense making thing:
use a database bruhkitty
I'm too lazy to learn sqlite xD
I’m too lazy to look up MongoDB
not knowing how to use a database is just a menace to your programmer worth
mhm

im going to learn postgres when i get my pc
!e
`import discord
import os
bot = discord.Client()
BotSyntax = "."
@bot.event
async def on_ready():
print("We have logged in as {0.user} ".format(bot))
@bot.event
async def on_message(message):
if message.author == bot.user:
return
if message.content.startswith == "$hi":
await message.channel.send("Hello!")
bot.run(os.getenv("Bot_Token"))
`
@timid depot :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | ModuleNotFoundError: No module named 'discord'
bruh
RIP
how will you get an environment variable
@timid depot #bot-commands
from an eval command
that too lmao

don't make me lose my mind 💀
smh, may I ask what is bot syntax
simple, you control
can't
How
bad
Eevee you’re not a programmer if you don’t have mental breakdowns
💀

Use the commands extension
Not a programmer
guess not
Nice meeting you Okimii
who r u?
Also bot should be named bot, client should be named client
I forgor 💀
Naming practices are important
Who am I
lol, mental and emotional both
and physical
maybe
or maybe all at once
Off-topic channels
There are three off-topic channels:
• #ot2-never-nester’s-nightmare
• #ot1-perplexing-regexing
• #ot0-psvm’s-eternal-disapproval
Their names change randomly every 24 hours, but you can always find them under the OFF-TOPIC/GENERAL category in the channel list.
Please read our off-topic etiquette before participating in conversations.
Was the Christmas Gift for @velvet tinsel haha
,-,
maybe not
This means war
can we not*
I can't type a normal sentence with some spaces I mean it is only send the first word..
?
*, message will fix it
add a * before message, ctx, *, message
,-,
Okay !
Haha slow typing go brrrr
I tried to do @client.command() but it says command isn't and attribute?
you are using discord.Client?
U need commands.Bot
Have you done from discord.ext import commands?
asynchronous function*
And that
!d discord.ext.commands.Bot
class discord.ext.commands.Bot(command_prefix, help_command=<default-help-command>, description=None, **options)```
Represents a discord bot.
This class is a subclass of [`discord.Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") and as a result anything that you can do with a [`discord.Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") you can do with this bot.
This class also subclasses [`GroupMixin`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.GroupMixin "discord.ext.commands.GroupMixin") to provide the functionality to manage commands.
discord.client() yes
do not use client for bots
yes
make an asynchronous function not a simple one
async def*
yeah i was going to add that later
am invisible?
If you want to use commands then use discord.ext.commands.Bot instead of discord.Client
yes you are, again
When u ain't 🤨
okay
smh
smh, how're you seeing me now
how do i install this https://github.com/imayhaveborkedit/discord.py/tree/voice-recv-ext/discord/ext/voice_recv
Magic
smh
I like magic
!ot
Off-topic channels
There are three off-topic channels:
• #ot2-never-nester’s-nightmare
• #ot1-perplexing-regexing
• #ot0-psvm’s-eternal-disapproval
Their names change randomly every 24 hours, but you can always find them under the OFF-TOPIC/GENERAL category in the channel list.
Please read our off-topic etiquette before participating in conversations.
Anyways imma just go instead of trolling and talking ot
Mwahahhaha
Waddle you do without us dave?
i would like to merge this with my current discord python pakage
how do i convert a timedelta into a datetime object?
I was about to write something but then someone asked a question so I think it’s rude not to answer and address the question so I am going to figure it out
https://stackoverflow.com/questions/2413391/how-to-convert-a-timedelta-object-into-a-datetime-object
So I found this @red blade
It doesn't make sense converting a timedelta object to a datetime object because timedelta represents an interval while datetime objects represent a time
ok well then is it possible to turn seconds into a datetime?
You want to add seconds to a datetime?
yes
Make the seconds a timedelta and add it to the datetime object using +
then i get this Command raised an exception: AttributeError: type object 'datetime.datetime' has no attribute 'timedelta'
because i need datetime and timedelta
and now i got this AttributeError: module 'datetime' has no attribute 'utcnow' after changing somethingf
Can someone help me? I’m trying to paginate my help command and it gave me this error from discord.ext import menus
Seems like menu doesn’t exist
You have to install it seperately
What do I install?
pip install discord-ext-menus
Okay ty
help?
@bot.command()
async def test(ctx):
embed = discord.Embed(title = 'ticked blyat',timestamp = ctx.message.created_at)
await ctx.send(embed=embed, components = [
Button(style = ButtonStyle.green, label = 'Create Ticket'),
Button(style = ButtonStyle.red, label = 'Delete Ticket')])
responce = await bot.wait_for('button_click')
if responce.component.label == 'Create Ticket':
await responce.respond(content = 'create')
# responce.component.disabled = False
elif responce.component.label == 'Delete Ticket':
await responce.respond(content = 'delete')
im trying to do a slash command everything is fine but it sends this error:
[WARNING] Failed to overwrite global commands due to __init__() got an unexpected keyword argument 'name_localizations'
code
nothing wrong with it i get it before the on_ready event gets invoked
ill still give it to you
@bot.slash_command(description="test description of a slash command")
async def slash(inter, num: int):
await inter.response.send_message("the slash command works!")
probably you added another argument which wasnt required
which library?
I believe it's responce.reply/response.send. What library are you using?
disnake
interesting
inter.reply.
why is that so?
from discord_components import DiscordComponents, Button, ButtonStyle
Guys i'm searching for a hosting to host a bot. The bot is very basically so it doesn't need huge storage. Paris or German location
I suggest somehost.xyz.
i went with the api idk why its not working
how do I create a limit by pressing a button?
Just increment a counter and if statement?
everything can click on this button, But after that, as some user clicked on it, it will not work
my bot doesnt respond to my slash command or even displays it?
@bot.slash_command(description="test description of a slash command")
async def slash(inter):
await inter.send("the slash command works!")
Have you specified test_guild_ids?
I don't know, but slash commands can take up to an hour to register if you have not specified the test_guilds
yeah i just saw
help
?
was missing that so thx
How do I fix this ,-,
@client.command()
async def btn(ctx):
await ctx.send("A button!", components=[Button(label="Click Me!", custom_id="button_1")])
inter = await client.wait_for("button_click", check=lambda inter: inter.custom_id == "button_1")
await inter.send("You clicked me!")
Which library?
discord_components
Hmmmmmm
nvm maybe I got it
I hate those libs ngl
I just needed to use some donkey brain of mine
shitty lib
like meeeeee
Whole disnake squad ic
😂
No
?
wth
Bruh what u don’t understand?
why memes in topical channel
,-, javascript
and not even python memes smh (please don't do that either)
Ye but I’m doing TypeScript etc.
Bro shut up
pardon me?
U heard me
FYI he's saying the correct thing and u shouldn't talk like that
??? Y’all skittles
<@&831776746206265384>
,-, this is a python dedicated server and this a topic channel, please avoid your memes and the kind of behavior you posses
<@&831776746206265384>
Eh
Welp my net ;-;
Bruhhhhh
Sorry for double ping
I'm faster /j
Bruh what sorry?
,-, I should become a teacher
More of my net is slow
!mute 853236129825554482 inv
Y’all trolling so hard
:incoming_envelope: :ok_hand: applied mute to @leaden prairie until <t:1638471104:f> (59 minutes and 59 seconds).
Thanks
.topic
Suggest more topics here!
properly working bot (well logging to be specific)
I hate most of them ngl
dunno ,-,
Facts
@bot.command()
async def test(ctx):
embed = discord.Embed(title = 'ticked blyat')
await ctx.send(embed=embed, components = [
Button(style = ButtonStyle.green, label = 'Create Ticket')])
responce = await bot.wait_for('button_click')
if responce.component.label == 'Create Ticket':
await responce.component.disabled = True
await responce.component.disabled = True
^
SyntaxError: cannot assign to await expression
Why it not work
I was joking lmao
Remove await from that line
phew
all you have to do is
from discord_components import DiscordComponents
DiscordComponents(bot)
and you can assign custom ids while making the button
DiscordComponents(bot)
where should I insert it?
down the bot constructor
Designing logging embeds is the second most boring thing to do
cant argue
MOST BORING THING IS WRITING DOCS
For me designing is the most boring thing to do
Ok I am done, no more caps now
so far I have made 2 of them, and then got bored ||because disnake broke my webhooks + some systems of embed generator||
Aw
Any type of designing

