#discord-bots
1 messages · Page 917 of 1
i was going to ask abt auditlogs but nvm i got it
how are you setting it up
it'll be, member.guild.id
a command
then make a command that sets the channel id and the "welcome message" and store it to ur db
and where are you saving it?
i know but I need also a channel for it
that was my plan so btw idk how to make this command
no it will be (imsmart: discord.Member) 🧞
@client.command() 
no no not this xd
discord.Client doesn't have commands
okay, just pretend I made a lame joke on this and you are laughing on that
i meant ```bot.command()
lol
eh im too lazy to add (at symbol)
I mean what the code is for setting it up
which db you're using ? 
i think the one from replit
..
xd
ew
uh never used replit so idk wut u talking abt
good
use data monkey
I do it only for tests
sqlite
or nosql db 
it's my first bot
ew (was for @slate swan)
W thats great 
self.clear_items()
await self.ctx.edit(view=None)
return
``` ```
Task exception was never retrieved
future: <Task finished name='discord-ui-view-timeout-21a633582f1c4ab77ca9f402b79c0a1f' coro=<MyView.on_timeout() done, defined at C:\Users\nikit\PycharmProjects\dpamong\docs\main.py:316> exception=AttributeError("'Context' object has no attribute 'edit'")>
Traceback (most recent call last):
File "C:\Users\nikit\PycharmProjects\dpamong\docs\main.py", line 318, in on_timeout
await self.ctx.edit(view=None)
AttributeError: 'Context' object has no attribute 'edit'
Task exception was never retrieved
future: <Task finished name='discord-ui-view-timeout-097721d9b6fad66bd06ae94fd77f94ed' coro=<MyView.on_timeout() done, defined at C:\Users\nikit\PycharmProjects\dpamong\docs\main.py:316> exception=AttributeError("'Context' object has no attribute 'edit'")>
Traceback (most recent call last):
File "C:\Users\nikit\PycharmProjects\dpamong\docs\main.py", line 318, in on_timeout
await self.ctx.edit(view=None)
AttributeError: 'Context' object has no attribute 'edit'```
but I'm thinking about to buy a vps
i mean im just too lazy to learn (CREATE table TEXT) stuff like these 💀 so thats why i prefer nosql cuz it has the same syntax as json 
if you want i can dm you the full command
OMG
oh
oh really? I have experience in JSON
its not the exact same
anyone know why this is happening?
then use mongodb
(easy to learn)
Hey, Im trying to run a discord bot atm but im getting this error when running it. This works perfectly fine on my VPS but not my local machine?
Cannot connect to host discord.com:443 ssl:default [The parameter is incorrect]
https://pastebin.com/YMPUCutv
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
You cant use `` or any other message formatting things in the footer
better off using "
ok i like that way
how to fix this when someone other issues command and shows the older message same thing as new message
when changing pages*
me just seeing MR. Soop get ignored
this thing updates the whole thing i think
youtube videos 😎
and what's user = member for
what's the issue overall
didn't understand your message before
wdym issue
Hey, Im trying to run a discord bot atm but im getting this error when running it. This works perfectly fine on my VPS but not my local machine?
Cannot connect to host discord.com:443 ssl:default [The parameter is incorrect]
https://pastebin.com/YMPUCutv
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Hey im getting an error
code
"pop_random_line1" is a string, not a function, make sure you didnt overwrite it previously
`def pop_random_line1():
"""picks a random line from a file, then deletes the line"""
with open("Day Chair Keys.txt", "r") as file:
lines = file.readlines()
chosen_index = random.randrange(0, len(lines))
chosen_line = lines[chosen_index]
with open("Day Chair Keys.txt", "w") as file:
del lines[chosen_index]
file.writelines(lines)
return chosen_line
@client.command()
async def DayChair(ctx):
roles = [role.name for role in ctx.message.author.roles]
if 'Owner' in roles:
line = await pop_random_line1()
await ctx.message.reply(line)
else:
await ctx.message.reply("You don't have the permission to execute the command!")
await asyncio.sleep(5)
await ctx.send("INSTRUCTIONS WILL BE TYPED HERE")
`
i just stated my code, whats the fix for it
try renaming pop_random_line1() to something very unique like "ajsadoasipdas" just to completely rule out that the function is getting overwriten
oh
yeah lmao
your using an await on a none asnync function, change "def pop_random_line1():" to "async def pop_random_line1()"
or just remove the await
what do you mean
he meant run the command
sure no one will ban me for that lmfao, but your right., not worth the risk
ay @slate swan thanks for the help pal
oh invoke, well what happens then ah, ah?
kk
so basically when enter the command and change pages it goes everything well (shows my inv)
but when other user enters the same command (if he changes pages of his own msg it shows his inv)
and i change my page it shows other users inventory
you should make a new View object everytime when entering the command
show the command
uh
send him in dms
why
cuz no flood?
nobody steals code here
I do /j
especially not youtube tutorial code based on the naming
this doesn't show much
Just send whole code in dms cuz it is very big
if name .:
name = .. 25x
!paste
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 floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
Don't do this
virus
??
don'tn'tn't do this
it does
if i enter the command and change pages it shows mine but like if someone enters the command it shows the someone's other inventory instead of mine
if you enter a member?
that's exactly what you coded
i hope that explains
https://www.youtube.com/watch?v=HPaadO_sRD4 you watching this?
In this video, we will learn how to make an Economy System for a Discord bot in python using discord.py (rewrite) in 2020. We make the balance and beg command in this video.
If you have any suggestions for future videos, leave it in the comments below.
Some Useful Links -
Discord Developer Portal- https://discord.com/developers
My Disco...
but it works for hypeblox
hypeblock
shut
dym
yea it works for him
how's your json?
It's my name
but for me it shows his inv
well idk then bro
but like
watch the swastik video again 😿
if he issues the command it shows his inventory for me
i want to make so my issued command doesnt update into his inventory
but when he uses it shows his
how to play an audio file?
double click on .mp3 file?
Hey, Im trying to run a discord bot atm but im getting this error when running it. This works perfectly fine on my VPS but not my local machine?
Cannot connect to host discord.com:443 ssl:default [The parameter is incorrect]
https://pastebin.com/YMPUCutv
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
if member = None
await ctx.send("Please mention a user")
``` How do I do this in the right way?
its simple py
if member is None:
...
if member == None:
#ur code```
ok
ok xD
ok
use is its better
the problem wasnt even related to the operators and the error says it all?
first at all:
He tried to set member to none while checking. + there was no :
bro you can set a variable and check it in a if statement?
What, my brains died
that's why i'm asking this in this channel bro
@commands.command()
@commands.has_permissions(kick_members=True)
async def ban(self, ctx, member: discord.Member, *, reason=None):
if member == None:
await ctx.send("Please mention a user")
else:
await ctx.guild.ban(user=member, reason=reason)
channel = self.client.get_channel(954837357239091260)
embed = discord.Embed(title=f"{ctx.author.name} banned: {member.name}", description=reason)
await channel.send(embed=embed)
await ctx.send(f'Banned **{member.name}** for **{reason}**')
``` Should the if member maybe need to be like member: discord.Member since that is a error
@commands.command()
@commands.has_permissions(kick_members=True)
async def ban(self, ctx, member: discord.Member = None, *, reason=None):
if member == None:
await ctx.send("Please mention a user")
else:
await ctx.guild.ban(user=member, reason=reason)
channel = self.client.get_channel(954837357239091260)
embed = discord.Embed(title=f"{ctx.author.name} banned: {member.name}", description=reason)
await channel.send(embed=embed)
await ctx.send(f'Banned **{member.name}** for **{reason}**')
Why?
how do I remove all specific members from a channel? like if the member has specific permissions to see a channel (not bc of his role) it removes him
!e
if not (a:=0): print("lol")
@slate swan :white_check_mark: Your eval job has completed with return code 0.
lol

@slate swan
how do I remove all specific members from a channel? like if the member has specific permissions to see a channel (not bc of his role) it removes him
isnt their an attr that shows all the members that can see the channel?
idk
ah I found it
that command is something else no jk
@client.command()
async def ping(ctx):
await ctx.send("**Pong!**")
Anyone know why I'm getting this error:
Ignoring exception in command None:
discord.ext.commands.errors.CommandNotFound: Command "ping" is not found
Can you show more code?
Sure
!paste
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 floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
^ Use this, it's better than pasting it here.
Hey how do I that in this case?
@commands.command()
@commands.has_guild_permissions(manage_messages=True)
async def purge(self, ctx, amount=10):
if amount == None:
await ctx.send("Please enter a amount")
else:
await ctx.channel.purge(limit=amount+1)
channel = self.client.get_channel(954837357239091260)
embed = discord.Embed(title=f"{ctx.author.name} purged: {ctx.channel.name}", description=f"{amount} messages were cleared")
await channel.send(embed=embed)
await ctx.send(f'**{ctx.author.name}** purged **{amount} messages**')
set 10 to None
import discord
from discord.ext import commands
client = commands.Bot(command_prefix = ";")
#OnStartPrintStatement
@client.event
async def on_ready():
print("Connected to Discord. Your bot is online.")
#Left
@client.event
async def on_member_remove(member):
print(f"{member} has left the server.")
#Commands
@client.command()
async def ping(ctx):
await ctx.send("**Pong!**")
client.run("nothing to see here...")
Oh wait
member cannot be None. If discord.py can't resolve the member from the input the invoker provides, then commands.MemberNotFound is raised. You will have to catch this in a command error handler if you intend to check for it.
I got that fixed already bro but thanks
how can i make a cmd like
!findrole <str>
and it will find the closest role to the string
@slate swan Can you also please show the traceback from the error?
question. if someone miss spells "sent", i would like to get the bot it to say, Please try again invalid work, m y code is listed below
elif message.content.lower() == 'sent': await message.channel.send('Alright Perfect Please Send A ScreenShot Of Payment Being Sent. Once Done Please Write **Proof Is Sent**')
Me or?
You here?
Ignoring exception in command None:
discord.ext.commands.errors.CommandNotFound: Command "ping" is not found
That's the only error I get
Oh right I didn't even read your question properly. I'm assuming you provided a default value of None for member.
But I don't think anything's wrong..
Yup
@commands.command()
@commands.has_guild_permissions(manage_messages=True)
async def purge(self, ctx, amount=None):
if amount is None: #if amount == None:
await ctx.send("Please enter a amount")
return
await ctx.channel.purge(limit=amount+1)
channel = self.client.get_channel(954837357239091260)
embed = discord.Embed(title=f"{ctx.author.name} purged: {ctx.channel.name}", description=f"{amount} messages were cleared")
await channel.send(embed=embed)
await ctx.send(f'**{ctx.author.name}** purged **{amount} messages**')
``` Never used cogs in my life. Basically If amount is none it just returns.
question. if someone miss spells "sent", i would like to get the bot it to say, Please try again invalid work, My code is listed below
elif message.content.lower() == 'sent': await message.channel.send('Alright Perfect Please Send A ScreenShot Of Payment Being Sent. Once Done Please Write **Proof Is Sent**')
lemme try okay
This is an error I have not seen before, why is that?
question. if someone miss spells "sent", i would like to get the bot it to say, Please try again invalid work, My code is listed below
elif message.content.lower() == 'sent': await message.channel.send('Alright Perfect Please Send A ScreenShot Of Payment Being Sent. Once Done Please Write **Proof Is Sent**')
It has been working for a while with my code
use is and you can save a line in the if statement!
I tested your code, nothing is wrong with it. Can you try rerunning it?
or this
!paste Can you show more code?
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 floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
Yes
you need to make amount a int and add a value of 1
Yo
oh wait
question. if someone miss spells "sent", i would like to get the bot it to say, Please try again invalid work, My code is listed below
elif message.content.lower() == 'sent': await message.channel.send('Alright Perfect Please Send A ScreenShot Of Payment Being Sent. Once Done Please Write **Proof Is Sent**')
i’m trying to make it so when a specific command is ran it changes the channel overwrites, however one of my overwrites is user and when i use it in a command i can’t use user=interaction.user, because i want to stop the user who interacted seeing the ticket.. i don’t know how to do this
thats fine but im not sure why the error raised maybe that raised it lol
idk
how do i fix this brh
question. if someone miss spells "sent", i would like to get the bot it to say, Please try again invalid work, My code is listed below
elif message.content.lower() == 'sent': await message.channel.send('Alright Perfect Please Send A ScreenShot Of Payment Being Sent. Once Done Please Write **Proof Is Sent**')
@commands.command()
@commands.has_guild_permissions(manage_messages=True)
async def purge(self, ctx, amount=0):
if amount == None:
await ctx.send("Please enter a amount")
return
await ctx.channel.purge(limit=amount+1)
channel = self.client.get_channel(954837357239091260)
embed = discord.Embed(title=f"{ctx.author.name} purged: {ctx.channel.name}", description=f"{amount} messages were cleared")
await channel.send(embed=embed)
await ctx.send(f'**{ctx.author.name}** purged **{amount} messages**')
``` That won't work, right?
typehint amount to an int
@slate swan here https://paste.pythondiscord.com/etecugifok
How? and where
@commands.command()
@commands.has_guild_permissions(manage_messages=True)
async def purge(self, ctx, amount: int):
if amount <= 0:
return
await ctx.channel.purge(limit=amount+1)
channel = self.client.get_channel(954837357239091260)
embed = discord.Embed(title=f"{ctx.author.name} purged: {ctx.channel.name}", description=f"{amount} messages were cleared")
await channel.send(embed=embed)
await ctx.send(f'**{ctx.author.name}** purged **{amount} messages**')
``` Maybe this will work
amount: int = 1
@slate swan Would that work?
so much things to make better tbh
Try responding to them ephemerally and then changing the overwrites.
is there anyway i can define interaction.user in a command?
@slate swan did you find the prob? Idk why this is happening. everything is fine i think?
How do I?
.
how to make a delay till the bot response?
ah k didnt see
async def purge(self, ctx, amount: int = 1):
yep
There's no issue with your code as I established earlier. I'm not sure what's going wrong, can you try rerunning the code?
game coming along nicely, have sprites for dynamite and other items now. only shows explosions on non dug out land
oooh
I'm not sure what you're trying to do, why do you need to define interaction.user?
I have before. Do you think it's a problem with VS?
@slate swan Are you using the commands extension?
VS as in Visual Studio? No, that's not probable.
because when someone runs the command i want the view_channel perms to become False for the user to created that ticket using the button
pretty nice
Oh
should add hp
Josh, how are you running your code?
Try debugging maybe
^ @slate swan
@commands.command()
@commands.has_guild_permissions(manage_messages=True)
async def purge(self, ctx, amount = int = 1):
if amount == None:
await ctx.send("Please enter a amount")
return
await ctx.channel.purge(limit=amount+1)
channel = self.client.get_channel(954837357239091260)
embed = discord.Embed(title=f"{ctx.author.name} purged: {ctx.channel.name}", description=f"{amount} messages were cleared")
await channel.send(embed=embed)
await ctx.send(f'**{ctx.author.name}** purged **{amount} messages**')
``` How do I do that like amount = int = 1 xD
what’s that?
Hello!
Who can help me?
timtoy take over ima take a break
For some reason everything seems to be correct but it's giving me an error that shouldn't be there
How are you planning to write said command? Are you intending on using interactions or just regular message content commands?
Ask away
Anyone please
Can i DM you?
Types are hinted by :, not =
foo: str = "bar"
like amount : int = 1
Here, foo is hinted as str
Correct, but there shouldn't be whitespace, between the variable and the colon that is
@commands.command()
@commands.has_guild_permissions(manage_messages=True)
async def purge(self, ctx, amount: int = 1):
if amount == None:
await ctx.send("Please enter a amount")
return
await ctx.channel.purge(limit=amount+1)
channel = self.client.get_channel(954837357239091260)
embed = discord.Embed(title=f"{ctx.author.name} purged: {ctx.channel.name}", description=f"{amount} messages were cleared")
await channel.send(embed=embed)
await ctx.send(f'**{ctx.author.name}** purged **{amount} messages**')
well i’m just using:
@bot.command()
@commands.has_role('Other Middleman')
async def close(ctx):
guild=bot.get_guild(879189880511557632)
embed=discord.Embed(description=f"**Ticket has been closed**", color=discord.Colour.yellow())
category = discord.utils.get(ctx.guild.categories, name = "CLOSED TICKETS")
fox = guild.get_role(925444830480453644)
await ctx.channel.edit(category = category)
await ctx.reply(embed=embed, view=end_ticket())```
Trying to revive ah,ah
You want to use a colon to tell discord.py that you will only accept amount if it can be converted to a valid int
The typehint only tells discord.py to cast it to int
discord? nvm u mean dpy
Regardless if it's valid or not I'm pretty sure it tries to run
thanks
Hello, I have a new error with my ticketing bot that I have never seen before
Here is my code: https://paste.pythondiscord.com/etecugifok
trying to think of a fun way to give visual feedback when a player teleports or uses an energy item
Hey @slate swan!
You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.
i was going to make a glow outline around them in different colors but its messy with cosmetics
Hey @slate swan!
You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.
Since nothing seems to work do you have any suggestions?
I'm not sure this is relevant but what version of Python are you running this with?
3.10.2
50% opacity blue lines infront of the person for teleporter could work
This will also just purge when I just do .purge, then I don't want it to purge
How are you invoking the ping command?
timtoy?
;ping
Can you also run python3 -m discord -v and show us the version
instead of amount +1use await ctx.message.delete
That would mean you need two API calls instead of one
He rlly needs help
Not a very good optimisation
Ok so there's a couple things wrong here.
You don't have to use bot.get_guild() here. Use ctx.guild instead.
Why do you need to call ctx.reply()? The command should just close the ticket and that's the end of it, right?
The fox variable is unused from what I can see.
!d discord.ext.commands.Context.reply
await reply(content=None, **kwargs)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
A shortcut method to [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send") to reply to the [`Message`](https://discordpy.readthedocs.io/en/master/api.html#discord.Message "discord.Message").
New in version 1.6.
Changed in version 2.0: This function will now raise [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "(in Python v3.10)") or [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.10)") instead of `InvalidArgument`.
It replies to the message that invoked the command, are you sure you want this? Did you mean to use ctx.send() instead?
does this mean bots can join group dms
why are you asking this here mate
it's #discord-bots
for python.
yes but nobody knows stuff to this detail here
okay
maybe this is why you're almost banned 😳
i use ctx.reply because it responds with more buttons so a mod can choose what to do next
Uh, no. Bots cannot use this endpoint.
That endpoint also creates a group dm, it doesn't join one.
wuts the point of discord making this lmao
Why they still have it documented publicly? I'm not sure.
Why they have it in the first place? Because regular users exist. We are allowed to create group channels.
maybe they support Tos breakers
No, the distinction between regular user accounts and bot accounts wasn't always this defined.
ah 
This basically means, give the bot Oauth2 scopes, to gain the access tokens, then just call this endpoint with the list of access tokens & their respective IDs. This then creates a group DM with all those user, not including the bot
Before Discord implemented OAuth2 for adding bots to guilds, you had to basically scrape invite links to join guilds. It was a weird time.
Oauth2 can preform actions like this, for an example making a member join a guild
not including the bot? 
😢
Well bot's can't exist in a group DM
Gotta keep up the hard work for discord to add this feature
I'm also pretty sure you need Discord to actually give you access to request said scopes.
Go through code grant
And I completely forgot why this is publicly documented. Thanks for the refresher.
No not this I was thinking of something else lmao
You'd request the same way you make your bot's invite URL 😃
You can add scopes, such as gdm.join
That one is a bit annoying I find
I usually cut it out of the url before accepting.
One time I got added to like 3 guilds
And got 6 automated DMs
Oauth2 is just annoying in general
I refuse to read the RFC, I got tired of RFCs after reading all of websockets
I mean it's not that bad
is discord planning to add bots to group dms
No
we need this feature like real bad
Strong 100% no
No
why not though
no
Why need it though?
Bots are meant for guilds, really.
so people in the gc can use the bot
Just make a guild????
I mean you can do more fishy stuff in DMs
how to make a delay till the bot response?
but what if you have oauth2 and deleting a guild is super annoying
Besides, making a guild is now simpler than ever. It literally takes 4 clicks.
Getting an access token is much harder than deleting a guild
true
Does anyone know how I would go about seeing WHO updated a "member"
@client.event
async def on_member_update(before, after):```
how to make a delay till the bot response?
What?
You mean 2FA?
Besides you enabled 2FA, cope.
Discord forced me to enable 2FA
How so?
creating teams in developer portal requires 2FA
Ha that feature sucks, I'm surprised you even use it
ikr
Haven't heard of anyone even actually using it for real
Last time I checked the payout system didn't even work
moderating discord server (To have moderation powers you must have 2fa)
It's just another one of those things Discord wasted their R&D on.
It was your choice to moderate someone else's server.
Not unless they turned on a setting
Discord isn't forcing anything upon you. If 2FA is inconvenient enough, just opt out of it.
Community servers require 2FA anyways.
sprite behind player after using teleporter, look okay? 🤔
Wrong channel
Kind of useless anyways
coroutine asyncio.sleep(delay, result=None)```
Block for *delay* seconds.
If *result* is provided, it is returned to the caller when the coroutine completes.
`sleep()` always suspends the current task, allowing other tasks to run.
Setting the delay to 0 provides an optimized path to allow other tasks to run. This can be used by long-running functions to avoid blocking the event loop for the full duration of the function call.
Deprecated since version 3.8, removed in version 3.10: The `loop` parameter. This function has been implicitly getting the current running loop since 3.7. See [What’s New in 3.10’s Removed section](https://docs.python.org/3/whatsnew/3.10.html#whatsnew310-removed) for more information.
Example of coroutine displaying the current date every second for 5 seconds:
@narrow grail ^
is a bot game
Your are currently asking for design choices on your game, not any bot using it 😃
😓
!e
print(type(discord.Role))
@rocky trench :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | NameError: name 'discord' is not defined
absolutely not.
discord.Role is an instance of type, what are you attempting?
how do i fix this?
code : https://paste.pythondiscord.com/asaquhopaq
What are you trying to fix?
bruh
basically i enter command and loads my inventory then friend enters command too and loads his inventory and then when i switch pages it shows his inventory not mine
Good luck, your code is a pretty unholy mess to read and diagnose.
That's due to the fact that you're just parsing a json file
Use a database instead, it should make the process easier
how
according to the start of your clip you do have a cookie in your second page, but regardless the likely issue is that you're using a bot variable to store the pages
well they do
I have cookies in second page
ye pretty much it doesnt...
Atleast it doesn't use space
so was the start of the clip another reproduction of the bug too?
the likely issue is that you're using a bot variable to store the pages
code here
it doesnt seem necessary to have a bot var in the first place
define your help_pages as a regular variable and it won't get shared across commands
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Bot' object has no attribute 'help_pages'
msg = await ctx.reply(embed=help_pages[current])
are you using bot.help_pages anywhere else?
no only inventory command
it means they have their dms locked, probably so they dont get annoyed by mass DMs...
Your bot seems to facilitate cheats, and in this server we don't help with projects that break ToS
then that error means you still have a line that's using bot.help_pages
Fixed! Thanks really much we spent 3 hours to fix it ;-; (Yes we dump, p but b)
can i somehow check how many times a user has boosted the server?
discord doesnt provide that information
Does anyone know why this is happening at all? Admin perms work but otherwise everything else says invalid permissions?
whats the invite link?
well the permissions is wrong
A small calculator that generates Discord OAuth invite links
well you used it wrong
As temp fix just use 8 for permissions
mk
That works but my bot doesnt need admin perms.
how do other bots check it then
for example "booster bot"
Did booster bot use python? Maybe.
What does python have to do here?
Regardless of language the API doesn't give out that information
You'd need to do inconsistent ways, such as tracking system messages 😃
does it only send out one message if you bought multiple boosts?
I remember getting two boosts, and boosting them seperately not all together, that produced two messages
Maybe boosting it all together would produce one message but I'm not sure
Well, the only thing the role does it let you know the user has boosted
Not the boost number, which they were trying to get
That's gonna be very API Intensive
Also what about bot outages?
Then you have dead data
Either way discord never meant for bot's to be able to do this
Same thing with invite tracking, they discourage it because of advertising or whatever
oh i only just noticed, booster bot doesnt seem to have any feature for listing the boost count for a specific user, they can only state the total boosts which discord does provide with Guild.premium_subscription_count
(or maybe they can and i just cant tell from their docs)
I'm sure nitro boosting would fall under the same category
Is this cog fine? When I run the command, the embed isn't sent however I don't receive any error too. I'm a bit confused. https://pastebin.com/cegdZNfa
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Are you sure that the extension is loaded?
why do my buttons timeout even if i have timeout=None
well i’ve kept vsc open for a while, but i’m hosting it on heroku
The futures (or at least I think discord.py is using Future) won't timeout if you set the timeout to None
You'd have to stop the view manually or, if the bot restarted
i’m using pycord
Pycord forks discord.py
No, I'm saying it would only stop working if you stopped the view manually
Not sure why it's "timing out"
These were my two assumptions
when no timeout is set there isnt actually any long-running future, the client simply dispatches the callback whenever it receives a matching interaction from the gateway
yeah they're pasting a couple tags from the dpy server
can someone thank danny for personalising discord.py for me
@client.command(name='demotar_o_g')
async def demotando_o_g(ctx, membro: discord.Member):
await ctx.send('demotando o glanchefeliz')
# get role and remove the role
role = discord.utils.get(ctx.message.guild, name='Trial')
await client.remove_roles(membro, role)
# add the role again
await asyncio.sleep(15)
await client.add_roles(membro, role)
how can i solve this error?: Command raised an exception: TypeError: 'Guild' object is not iterable
they used my birthday in an example
@bot.command(name = 'order')
async def order(ctx: commands.Context, *, echo: str) -> None:
msg = await ctx.send(echo)
await msg.add_reaction("👍")
await msg.add_reaction("👎")
await ctx.message.delete()
await ctx.send('You have 60 seconds to confirm! Press [placheolder thumbsup] to confirm! press [placeholder thumbsdown] to try again!')
channel = ctx.channel
def check(reaction, user):
return user == ctx.author and str(reaction.emoji) == '👍'
try:
reaction, user = await bot.wait_for('reaction_add', timeout=60.0, check=check)
except asyncio.TimeoutError:
await channel.send('Gotcha! order confirmed')
else:
await channel.send('you timed out...')
def check(reaction, user):
return user == ctx.author and str(reaction.emoji) == '👎'
try:
reaction, user = await bot.wait_for('reaction_add', timeout=60.0, check=check)
except asyncio.TimeoutError:
await channel.send('Understood! cancelling order!')
else:
await channel.send('you timed out...')
only the you timed out for the 👍 works. idk why. any help?
this code is very outdated.
well, they dont want to be referencing just guild in the first place
how can i update it?
your messages seem to be flipped around, but also when you use await bot.wait_for(...), the code after it cant run until that reaction completes
you should use just one check where the reaction can either be 👍 or 👎, then you can check the emoji again after they select one of them
AHHHH
so smthn like this
def check(reaction, user):
return user == ctx.author and str(reaction.emoji) == '👍'
try:
reaction, user = await bot.wait_for('reaction_add', timeout=60.0, check=check)
except asyncio.TimeoutError:
await channel.send('Gotcha! order confirmed')
else:
await channel.send('you timed out...')
return user == ctx.author and str(reaction.emoji) == '👎'
try:
reaction, user = await bot.wait_for('reaction_add', timeout=60.0, check=check)
except asyncio.TimeoutError:
await channel.send('Understood! cancelling order!')
else:
await channel.send('you timed out...')
the ident was wrong but u get the point
uhhh
the idea is that you only use one wait_for and have the check accept either reaction, then you can decide based on which one they chose afterwards
mhm
okk
sooo
im just gonna remoe the timeout altogther
@hushed galleon now, its there any way to make it so if they press 👍 pressing 👎 wont do anything? (and vice versa)
well having just one wait_for would do that for you
cause it returns after one reaction
@hushed galleon but how would i make it so it only uses 1 wait for with this new code?
channel = ctx.channel
def check(reaction, user):
return user == ctx.author and str(reaction.emoji) == '👍'
try:
reaction, user = await bot.wait_for('reaction_add', check=check)
except asyncio.TimeoutError:
await channel.send('you timed out...')
else:
await channel.send('Gotcha! order confirmed')
def check(reaction, user):
return user == ctx.author and str(reaction.emoji) == '👎'
try:
reaction, user = await bot.wait_for('reaction_add', check=check)
except asyncio.TimeoutError:
await channel.send('you timed out...')
else:
await channel.send('Understood! cancelling order!')
use one wait_for and have the check accept either reaction, then you can decide based on which one they chose afterwards
e.g. py def check(reaction, user): return reaction.emoji in ('👍', '👎')
ahhhhh
wait so smthn like this:
def check(reaction, user):
reaction, user = await bot.wait_for('reaction_add', check=check)
[thumbsup path here]
[thumbsdown path here]
hm i coulda sworn even unicode emojis were wrapped with discord.Emoji
i ididnt think so
ah whatever anyway, no you dont put the wait_for in the check
but yeah you'd have an if-statement to compare the thumbsup after the wait_for
wait so smtn like if return user == ctx.author and str(reaction.emoji) == '👍': and same for the thumbsdown
no, the check should return true for either emoji they choose
that way you can handle both reactions in one wait_for()
its just having an if-statement
sooo im just talkin in english here but:
reaction, user = await bot.wait_for('reaction_add', check=check)
if reaction is ('👍', '👎'):
[thumbsup path]
[thumbsdown path]
the check would have that double emoji condition, but afterwards you can check which specific emoji they chose
like how i showed up here
it should be shorter than the initial code you wrote
im so confused 
get thumb reaction from user (wait_for + check)
if reaction is thumbs up
confirmed
else cancelled
this isnt right at all but is the concept right/ am i on the right track?
channel = ctx.channel
def check(reaction, user):
reaction, user = bot.wait_for('reaction_add', check=check)
if 'reaction_add' == '👍':
do thing
if 'reaction_add' == '👎':
do OTHER thing
@hushed galleon ^
no not inside the check itself
Almost, don't put the do thing and do OTHER thing inside the check. Place it outside like this:
channel = ctx.channel
def check(reaction, user):
return user == ctx.author and str(reaction.emoji) in {'👍', '👎'}
try:
reaction, user = await bot.wait_for('reaction_add', check=check)
except asyncio.TimeoutError:
await channel.send('you timed out...')
return # There's no point in continue running the code
if str(reaction.emoji) == '👍':
...
else:
# This means that: str(reaction.emoji) == '👎'
...
I also recommend that you check that it's inside the same channel!
ohhh so the check SPEFICALLY LOOKS for the thumbs up.
or thumbs down
the check should return true for either emoji they choose
Yes, the check filters out (by ignoring) any other reaction than the ones made by the user and where the emoji is 👍 or 👎
and that alows the else to only be the thumbsdown soooo u dont need to check speratly for it 🤯
The latter is done by str(reaction.emoji) in {'👍', '👎'}, if str(reaction.emoji) is 👍 then it is inside {'👍', '👎'}. Same goes for 👎
gotcha
Note that I explicitly choose to use {} for the in {'👍', '👎'}.
This is because {} means both a dictionary, and a set. Now, when you have a , Python will recognize it as a set but if you have : it will understand it as a dictionary.
good to know!
A set is much more performant at checking if one thing is inside the other. The same way that a dictionary is better at looking up keys
All you can do with a set is add or remove keys, and check if a particular value is in it (which is very fast).
That's exactly what we want to do!
To be clear, {'👍', '👎'} is a set and {'👍': None, '👎': None} is a dict
i prob should be looking for ways to optimize my code....
got it bc the : is making it a dic
although for a two-element set the performance difference is in the nanoseconds and uses about 4x the memory (216 bytes vs. 56 bytes) ```sh
py -m timeit -n 500000 -s "s = {'1', '2'}" "'3' in s"
500000 loops, best of 5: 16.5 nsec per loop
py -m timeit -n 500000 -s "s = ('1', '2')" "'3' in s"
500000 loops, best of 5: 29.8 nsec per loop```
They don't, but if there are duplicates they will be removed because there cannot be duplicates
It's a frozenset stored on the function
and this code will not break if they add another reaction right? bc that was a HUGE exploit for my other code
!e ```python
import dis
def check(arg):
return arg in {'👍', '👎'}
dis.dis(check)
@minor totem :white_check_mark: Your eval job has completed with return code 0.
001 | 4 0 LOAD_FAST 0 (arg)
002 | 2 LOAD_CONST 1 (frozenset({'👍', '👎'}))
003 | 4 CONTAINS_OP 0
004 | 6 RETURN_VALUE
oh thats pretty cool
wait is there a way to see how intensive, fast, etc. your code is?
Yup 😅 - but you did bring up a good point. Not all cases require a set but I like showing it when I can
🗿
You can only but time it
It won't, no, because the check will return False and it will be ignored.
damn you got everyone laughing 
briish
thtas what i thought, bc ur smart and made it so it only pay attention to the thumbs reactiond
in most python applications you shouldnt worry about performance until it becomes a problem, and especially with a discord bot, those small optimizations pale in comparison to your network latency
need help, how to make the author id is avaivable for everyone, not only 1 person
make two checks
if message.channel.id == ...: return
await react(...)```
as in you want it to react to any message in that channel?
meh same shit
you just... dont check the user's id then
Yup, there's some easy things you can do for loops though. Python is slower than most languages, but all inefficient programs are inefficient in all languages 😅
thanks 
thanks 
if str(reaction.emoji) == '👍':
await channel.send('Gotcha! order confirmed')
channel = bot.get_channel(636399538650742795)
await channel.send(f"<@{user_id}> \n", echo )
why is send undefined?
was the error along the lines of NoneType has no attribute send?
anyone know why bot.user returns _MissingSentinel? checked src code still not sure why it would return the class
that would likely mean get_channel was none
yes
depends
if its for moderation its ok but you will always need a reason for logging actions
discord doesnt quite like it when you store allot of data in their platform
youll be fine

in what use case does it return this?
No, and write a privacy policy/tos for your bot if you’re concerned legally about it
Otherwise, it’s likely that nobody gives a shit
not really sure im checking bot base class
well it would be before the client is logged in
property user```
Represents the connected client. `None` if not logged in.
would return a NoneType error but i checked ClientUser and now im checking base
I think that’s the channel let me double check
new error: : Command raised an exception: TypeError: Messageable.send() takes from 1 to 2 positional arguments but 3 were given
if str(reaction.emoji) == '👍':
await channel.send('Gotcha! order confirmed')
channel = bot.get_channel(954898254783459388)
await channel.send(f"<@{user_id}> \n", echo )
can someone help me? how can i update this code for the latest discord.py structure?
@client.command(name='demotar_o_g')
async def demotando_o_g(ctx, glanchefeliz: discord.Member):
await ctx.send('demotando o g')
role = discord.utils.get(ctx.guild, name='Trial')
await client.remove_roles(glanchefeliz, role)
await asyncio.sleep(15)
await client.add_roles(glanchefeliz, role)
Outdated code
Reading is hard
pls help
removing \n doesnt do anything so idk what the 3 pos args are
await channel.send(f"<@{user_id}> \n" + not, echo )?
@slate swan
liek that?
yes
just realized theres like a second difference between the cache getting populated and the gateway connecting to the bot
why have an f string an str concatenation?
and f strings are faster
3
not even 3 theres way more
f string is the only correct way lol
from __future__ import annotations
from disnake.ext.commands import Bot
import os
class Klaxo(Bot):
def __init__(self, token: str, cogsdir: str, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
self.token = token
self.cogsdir = cogsdir
async def on_ready(self) -> None:
print("Bots cache has been populated")
async def on_connect(self) -> None:
print(
f"Bot info:\nId: {self.user.id}\nName: {self.user.name}\nDiscriminator: #{self.user.discriminator}\nTag: {self.user.name}#{self.user.discriminator}\nGuild count: {len(self.guilds)}\nMember count: {len(self.users)}\nToken: {self.token}\nCog dir: {self.cogsdir}\nCreation date: {self.user.created_at}\n"
)
print("Bot has connected to the gateway")
def setup(self) -> None:
for filename in os.listdir("./cogs"):
if not filename.startswith("_") and filename.endswith("py"):
self.load_extension(f"cogs.{filename[:-3]}")
print(f"Loaded: {filename[:-3]}")
async def on_disconnect(self) -> None:
print("Bot has disconnected from the gateway")
def run(self) -> None:
self.setup()
super().run(self.token, reconnect=True)
is this over the top? i feel like it is
there is no error i just want a honest opinion if its over the top
especially the cogsdir argument
the initiate of the class
Why are you printing the name, discriminator and name+discriminator
Just print it once
Also cogdir and token is unnecessary
idk just me being over the top
Yes such thing
it doesnt even clutter the console it shows all the details which is pog
!d discord.Status
class discord.Status```
Specifies a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") ‘s status.
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.
Wouldn't it make sense to just add all cog loading into run
import requests
import os
import discord
from keep_alive import keep_alive
from discord.ext import tasks
from bs4 import BeautifulSoup
from discord.ext import commands
import asyncio
client = commands.Bot(command_prefix='xxx')
client._skip_check = lambda x, y: False
client.change_presence(status=discord.Status.idle)
await client.change_presence(activity=discord.Game(name="The Walking Dead Season 1"))
keep_alive()
client.run(os.getenv('tok'),bot=False)
client.run(os.getenv('tok'),reconnect=True)
``` is it correct?
You only call it there anyways
yes it would but it looks less cluttered in the run method
no in the constructor


Self bot smh
my class instance variable of my bot instance: 
anyone has cool complicated ideas for commands maybe api related
sed
Stock simulation, game engine (board games probably) or image manipulation without an external API
Use my NewEgg wrapper and make commands for deals on hardware
🗿
mhmmmm stock simulation sounds cool if i knew about stocks game engine sounds cool but generic and imagine manipulation never done it before so maybe ill try it to learn something new
when i see its src code
You don't want to see it

Game engines are pretty simple if you know what to do I guess
Look okay it works
That's all you need
yeah but idk any game suggestions?
chess?
if it works it works 
Exploding kittens?
But have you coded it
good point but thats not my point
Haven't seen that one yet
And it'd be pretty cool to play it inside discord
I mean, you asked for a complex project, not a non-generic one
How about a CHIP-8 emulator that works in discord
good point tring to prove my point but thats not really my point
By that I mean fully emulate codeblocks (acting as ROMs)
never heard of it im young
unlike you
ill try game engines with imagine manipulation 
Imagine manipulation
behing?
This keeps happening when I try to log a ctx.guild.id
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/nextcord/ext/commands/core.py", line 168, in wrapped
ret = await coro(*args, **kwargs)
File "/Users/ext/config.py", line 45, in setup
servers[str(ctx.guild.id)] = {}
AttributeError: 'NoneType' object has no attribute 'id'```
My code is
```py
@commands.command()
async def log(self, ctx):
with open("servers.json", "r") as f:
servers = json.load(f)
servers[int(ctx.guild.id)] = {}
with open("servers.json", "w") as f:
json.dump(servers, f)```
guild is None
yes but why is it none
Your running the command in a DM
lol
@commands.command()
async def join(self,ctx):
if ctx.author.voice is None:
await ctx.send("You must be in a voice channel to do this")
voice_channel = ctx.author.voice.channel
if ctx.voice_client is None:
await voice_channel.connect()
else:
await ctx.voice_client.move_to(voice_channel)```
Why is it telling me join is an invalid command?
but its ctx.guild.id
not ctx.author.id
I even did this and its none
Yea,
ctx.guild is NONE in DMs
It just makes no sense otherwise
Yea no duh
but look at this
If it's in DM's the guild is None
!e ```py
print(int(None))
@pliant gulch :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'
but its a Command
@pliant gulch :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | AttributeError: 'NoneType' object has no attribute 'id'
But it's in DM's
Then the guild shouldn't be None
idk ill figure it out ty
!e
print(int(“SDJJWKDKWJJD”))
hold on what 💀
Ik guys I ain’t dumb
int means integer which is always a solid number dont get confused with a float as a float is a decimal which is still a number
number with parameters you mean the int converter?
Never in all my years have I heard someone reference an integer as a solid number
guess im the first
hahah i was gonna poke fun at it as well
🗿solid
!e
list=[“g”,”h”] print(“”.join(list))
@buoyant igloo :x: Your eval job has completed with return code 1.
001 | File "<string>", line 1
002 | list=[“g”,”h”]
003 | ^
004 | SyntaxError: invalid character '“' (U+201C)

Guess there are liquid numbers? Maybe gaseous numbers?
and plasma numbers

Is there a way to have like a code block format better on mobile cuz it keeps messing up.
Is it possible to send empheral messages using ctx.send? Or the ones which are only visible to ctx.message.author
nope ephemeral messages only can be used on interactions
Umm any way I can just send the message to author like only visible to him/her?
dms ig
Ohh.....naah I mean in server
private thread or channel ig
Umm yea private thread is a good idea....thanks!
Would you know a way to format a codeblock on mobile so it doesnt mess up?
Not any consistent way, phones have dimensions, they can vary from phone to phone
It’s not a one size fits all thing
I know
discord already formats DESKTOP codeblocks in a “weird” way
I wouldn’t expect it to be an easier for mobile
Or can,
Hm
Is there a way to Detect if a user is on mobile?
if i want to react with a server emoji can i just do ?
await msg.add_reaction("954933649395048488")
if it's a custom emote u gotta do \:emote:
you should do
my_msg = await ctx.send("this is test")
await my_msg.add_reaction("here emoji")
and if it's a discord emote u can just add a \ infront of the emote
and u can copy & paste it
\🎉
so in this case it would be
await msg.add_reaction("\:accepted:")
doesnt matter about the name
so u can get the name/id
no, it depends on the emote, if it's a custom you'd get the name and emote id
@supple crescent do this
that would just return <:name:id>
which u need to copy, for instantce: !ducky_party
whatev ill juse use a discord emothe 🤷♂️
if u want to use the emote u gotta do that, otherwise doing \:whatever the name is:
wouldn't work
i have a doubt
you probably need to get the object
Yea ask
Yea we can
Wdym bro?
nah
im not sure if you can tag a vc ive never seen it done before
We can't tag
yeah
It's impossible
not sure if discord lets you at all
When
u just have to get it and just mention
you can, with the ID
Oh
see he just did
paste the id with the # format?
with a user account, you can start typing #!channel-name, but with a bot account, I think you have to do <#channel_id>
[#751591688538947646](/guild/267624335836053506/channel/751591688538947646/)
#751591688538947646
oh wait not #
Leave
ah
i thought discord didnt format vcs
Who can make a customized bot
um yes ican
Like fully customized
how do i bypass the paste bin thing. I am trying to post my code like that it will always say to use their paste bin servic

lmfao
the wut
wait
In dm ?
send ss
We can talk in dm?
k
its always dms
lol

nitro .....
Hey @brittle axle!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
!paste
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 floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

!e print("hell world")
@gaunt ice :white_check_mark: Your eval job has completed with return code 0.
hell world
i used to be happy for this
wanna see something
print((password_generator:=lambda num:f"Your new password is:\n{''.join(__import__('random').sample('1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$%^&*()_-+=|>.<,/?', num))}")(2))
one line password generator
Called it
you know me too much
i love making these types of things
can anyone help me with something complicated? its rly wordy so i dont feel like typing it if nobody feels like helping. its about pinging users in a spefic channel
what about the idea?
ok when somobody does !order the order the say goes into another separate channel where i have to review the order, if i accpet it, how can the bot ping them back in their channel that they did !order in?
here is the code
@bot.command(name = 'order')
async def order(ctx: commands.Context, *, echo: str) -> None:
msg = await ctx.send(echo)
await msg.add_reaction("✅")
await msg.add_reaction("❌")
await ctx.message.delete()
channel = ctx.channel
def check(reaction, user, ):
return user == ctx.author and str(reaction.emoji) in {'✅', '❌'}
try:
reaction, user = await bot.wait_for('reaction_add', check=check)
except asyncio.TimeoutError:
await channel.send('you timed out...')
return
if str(reaction.emoji) == '✅':
await channel.send('Gotcha! order confirmed')
channel = bot.get_channel(954898254783459388)
await channel.send(f"<@{user_id}> \n {echo} ")
await msg.add_reaction("✅")
await msg.add_reaction("❌")
channel =ctx.channel
def check(reaction, user):
return user == ctx.author and str(reaction.emoji) in {'✅', '❌'}
try:
reaction, user = await bot.wait_for('reaction_add', check=check)
except asyncio.TimeoutError:
await channel.send('you timed out...')
return
if str(reaction.emoji) == '✅':
return
else:
return
else:
await channel.send('Understood! cancelling order!')
the thing is, its a diffrent channel for diffrent people
bc each person has their own private channel
ig you can use a dict and save the channel id and author id for later
oh wait
is it like a ticket system
yeahhhh
hmmm
sure
!paste
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 floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
@gaunt ice you want to look at the order cmd and start cmd
https://paste.pythondiscord.com/iwicuremiw
okk
you could've shortened with ascii
gib me like 5 mins @supple crescent
no rush <3
im on phone lmfao
!e ```py
import string; print(string.printable)
@pliant gulch :white_check_mark: Your eval job has completed with return code 0.
001 | 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
002 |
003 |
example?

do you mean the emoji?
as the emoji is called this so you mean the emoji i suppose?
🤦♂️

how do I check if bot is able to give the mentioned role from the command?
do I check the role position or what ?
@supple crescent
thas me
im back on pc
alr sick
gib 2 mins
gotcha
Please ping if anyone know
Facepalming to Okimii

My two this meant to look above two messages
Like how you'd do ^^^ or something like people usually do
oki, stop acting weird
@supple crescent by ctx.message.delete() are u meaning to delete the "msg" in order cmd
it deletes the persons !order and just replaces it with a bot version
its just to clear space
here
whats diffrentr
the "bot.get_channel"
k let me try
AttributeError: 'NoneType' object has no attribute 'send'
await channel2.send(f"<@{user_id}> \n {echo} ")
i have to try laer sorry
np
🥄
🍴
bad code
- defined bot twice, second time was a subclassed one which was not even used
- bot.run is a method
- time.sleep blocking
umm
this isnt my code....
its actually meat's
he took out the token intentionally
was he supposed to send token?
The token has nothing to do with the other mentioned issues
this code aint mine......
Anyone know mongo?
Ok
is it (manage_guild) or (mange_server) for checking if they have permissions
manage_guild
thx
why does this say 69 hours lol
Because i have a theme, and before you lecture me about how its against ToS, ive had client modifications for upwards of 4 years, if discord cared that much they'd enforce the rule lol
Because everyone gives the same response
ive had people lecture me for years about it
Im aware of the risks
alr lol
Discord doesnt care as long as you're not doing anything malicious. Its not like someone would be able to prove that anyway, thats why they dont care
Yep that’s right
I uninstalled the discord modules to use nextcord, but changed my mind and reinstalled discord.py and discord again, only now it's giving this error
force reinstall
i personally use divmod cuz i find it easier, here's an example from dpy server ```py
from datetime import datetime
from discord.ext import commands
bot = commands.Bot(command_prefix="?", description="This is a bot")
bot.launch_time = datetime.utcnow()
@bot.command()
async def uptime(ctx):
delta_uptime = datetime.utcnow() - bot.launch_time
hours, remainder = divmod(int(delta_uptime.total_seconds()), 3600)
minutes, seconds = divmod(remainder, 60)
days, hours = divmod(hours, 24)
await ctx.send(f"{days}d, {hours}h, {minutes}m, {seconds}s")
!d divmod
divmod(a, b)```
Take two (non-complex) numbers as arguments and return a pair of numbers consisting of their quotient and remainder when using integer division. With mixed operand types, the rules for binary arithmetic operators apply. For integers, the result is the same as `(a // b, a % b)`. For floating point numbers the result is `(q, a % b)`, where *q* is usually `math.floor(a / b)` but may be 1 less than that. In any case `q * b + a % b` is very close to *a*, if `a % b` is non-zero it has the same sign as *b*, and `0 <= abs(a % b) < abs(b)`.
ahhhh
how can I do this?
python -m pip install --force-reinstall discord.py
if you are using 2.0 then ```
python -m pip install --force-reinstall git+https://github.com/Rapptz/discord.py
thx
i appreciate this, thanks man
some reason reply broke, but thanks again
Guys how to check if a message has walls of text or repeated text or too many emotes?
@minor totem
Hey... how do I get ppl knwing about my bot any good methods to get my bot onto servers?
I have 5 ways to do it
- Top.gg, Post your bot on top.gg and actively vote it
- Needed features,surf though the internet and check what users are interested in the botd to be added
- Customization, Make a cool little dashboard with a .xyz domain and make your bot customizable
- Hundreds of features,add as many features as possible to your discord bot and all must be customizable using dashboard.
5)Advertise it manually,advertising it manually by telling your friends about it also helps!
is it possible to put this embed field to other file and use it to my bot embed message?
Wdym,also why soo many words censored? Lol
private thing 😅
like i have separate file which is only with embed.add_field() and load that file to my bot command embed message
help
@bot.event
async def on_member_update(before, after):
if before.status != after.status:
return
if str(before.status) == "online":
if str(after.status == "offline"):
return
if str(before.status) == "offline":
if str(after.status == "online"):
return
if before.activity != after.activity:
req_act = "vanity"
my_server = bot.get_guild(guild id here)
role_id = role id here
role = my_server.get_role(role_id)
if act := [activ.name for activ in after.activities if activ.type == ActivityType.custom and req_act in activ.name]:
channel = bot.get_channel(bot channel id here)
emb = discord.Embed(color=0xffffff)
emb.description = f"thank for vanity"
emb.set_footer(text="meoww")
await channel.send(f"<@{after.id}>", embed=emb)
await after.add_roles(role)
else:
await after.remove_roles(role)
i want it to not ping the user again if they change or put a emoji in their status or if they change something in their status but it still has the vanity. is it possible? do i make sense?-
sorry




