#discord-bots
1 messages · Page 710 of 1
This is the Pypi packages, inside the root folder is the setup and additional information.
yeah ik
i just didnt think about it for a reason
ctx.send()
ctx is the class and .send is just a function /attr right?
Ctx is class instance
yes
And send is a method yes
!d discord.ext.commands.Context
class discord.ext.commands.Context(*, message, bot, view, args=..., kwargs=..., prefix=None, command=None, invoked_with=None, invoked_parents=..., invoked_subcommand=None, ...)```
Represents the context in which a command is being invoked under.
This class contains a lot of meta data to help you understand more about the invocation context. This class is not created manually and is instead passed around to commands as the first parameter.
This class implements the [`Messageable`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable "discord.abc.Messageable") ABC.
withing the class right
Context is just all the handy dandy variables inside one class.
Yes It’ s a method from context class
alr
ah lol
final one
how would i change a var from a class with a subclass right?
Wdym
You can also make your own custom context to include the database connection for example so you don't have to address that every time.
super() it.
yes ofc you need it to inherit everything from a class making it a subclass
Lemme write an example 1 sec
You're waiting for the event but that only ever happens once
discords domain isnt like that
how to make it happen more than once?
hmm, I wonder if just a while loop would work
i tried
!e ```py
class test_class():
def init(self, var: int) -> None:
self.some_var = var
@property
def var_retn(self) -> int:
return self.some_var
class test_sub(test_class):
def init(self, var: int, *args, **kwargs) -> None:
self.some_var = var
obj = test_class(5)
obj_sub = test_sub(10)
print(obj.var_retn)
print(obj_sub.var_retn)
@cloud dawn :white_check_mark: Your eval job has completed with return code 0.
001 | 5
002 | 10
panda i know how to subclass🕴️
you can use a View class and then do something like
import discord
class MyView(discord.ui.view):
@discord.ui.button(label="Your button's label")
async def [name of function goes here](self, button, interaction):
await interaction.response.send_message("Hello, world!") # this responds with Hello, world! whenever the button is pressed
async def your command stuff goes here(...):
await ctx.send(..., view=MyView())
that should work
Then why did you ask ;-;
is it a class variable? otherwise I don't think you can change it necessarily
i just wanted a yes or no response
i ment a obj my bad
A while loop would just spawn infinite Futures
That's a yikes!
This is why those libraries are poorly designed
im making a dumb command because im bored but it says "command not found"
ill show code
ik its a dumb command
I think It’ s @client.command()
With ((
()
ah thought i had that must've deleted it
anyone wanna make a discord bot with me? im bored.
I have a project but i need someone who can use flask too
and is good with web dev
But.. flask is sync ;-;
A bot dashboard doesn't need to be async lel
It does lol
why lol?
I'll think a way then D_D
i do async :0
Most python bots that have a dashboard do IPC routing.
my friend is good with web and hes helping me
Well, i need someone who can deal with the web side anyways lol
Not many people do that here. I've seen some but those people usually help others and are experienced coders.
Cant u have a separate application for dashboard
Yeah that's what you need to do async subclass.
But then with the IPC routes it's still better performance wise to make it async.
Wdym, I just make a bot and then a normal web application
In quarkus and react
You can do it yeah but it will be slower depending on the user base.
Make the whole bot sync if it is just one guild.
idm lol
I meant the site
Isn't react js..?
No
🤔
Clearly the language is react
Wdym
in the on_member_join event, how can I see which invite the person used, or who invited him?
!d discord.Invite
class discord.Invite```
Represents a Discord [`Guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild "discord.Guild") or [`abc.GuildChannel`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.GuildChannel "discord.abc.GuildChannel") invite.
Depending on the way this object was created, some of the attributes can have a value of `None`.
x == y Checks if two invites are equal.
x != y Checks if two invites are not equal.
hash(x) Returns the invite hash.
str(x) Returns the invite URL...
await invites()```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Returns a list of all active instant invites from the guild.
You must have the [`manage_guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_guild "discord.Permissions.manage_guild") permission to get this information.
I don't think you can see who invited who.
.inviter and .uses
actually
no
That will be the one who created the invite and how many times it is used.
No names.
You'd need to write some serious custom shit for that lmao
i realised
you can see which invite.uses changed
Yeah like i said custom, with large guilds that will be pretty difficult.
isnt everything ‘custom’? 
hi, for some reason, my python doesnt recognize discord any more, tried reinstalling python, didnt work
I too am sometimes blinded by the concept of 'Discord'.
my bad lol i meant pycord
Well..?
real quick, how do I check if a user has a specifically named role before running a chunk of code?
!d discord.Member.roles
property roles: List[Role]```
A [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role") that the member belongs to. Note that the first element of this list is always the default [‘@everyone](mailto:'%40everyone)’ role.
These roles are sorted by their position in the role hierarchy.
inb4 two users join at the same time
Yeah that is what i was implying.
so something like
if rolename in ctx.message.author.roles:
pass #codehere
?
It would never work, because it will loop through the role object, not the role name
more like ```py
if "rolename" in [role.name for role in member.roles]
LMAO
Bruh nice try though
ty
I wasn't implying that
ignore wiser btw, he just goes around trolling xD
.
Yeh but did they take it offline or something
Hmm
if it worked a month ago and it’s the same code it will work fine rn
weird
this worked tysm
Well mostly colabs here is to both know how to code.. hm
What do you want to create?
Games bot or even a moderation bot.
Do you got any experience?
little bit experience.
Hi it still doesnt work it says energy isnt a command
like i do the prefix then energy and it doesnt do anything in terminal or chat
Can you send your code instead of a screenshot?
!code
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.
yeah
**@client.command()
@commands.guild_only()
async def energy(ctx: commands.Context):
energy = [ "Heres 5 hour of energy",
"Heres one second of energy",
"Heres 10 hours of energy",
"Heres 24 hours of energy",
"Heres 1.5 hours of energy",
"Heres a week of energy",
"Heres 2 weeks of energy",
"Delete discord. Take a break",
]**
It seems like you've got no send method. You need to send a message. I believe what you're attempting is replying with a random item from that energy array; therefore, you'd need to do:
await ctx.send(random.choice(energy))
How do I check if message.content is only sent from ctx.author?
if ctx.message.content == verification_code:
wait_for function?
How do I use that?
they're asking whether you're using wait_for or no
No
then what are you using?
This is the whole command
https://paste.pythondiscord.com/iloyepisop.py
What has an atrubute to .send?
that will not work
abc.Messageable
use wait_for
Yeah I tested it didn't work
How tho
While using a on_ready function.
NameError: name 'get_channel' is not defined
!d discord.ext.commands.Bot.wait_for | see the example on that link
wait_for(event, *, check=None, timeout=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Waits for a WebSocket event to be dispatched.
This could be used to wait for a user to reply to a message, or to react to a message, or to edit a message in a self-contained way.
The `timeout` parameter is passed onto [`asyncio.wait_for()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for "(in Python v3.9)"). By default, it does not timeout. Note that this does propagate the [`asyncio.TimeoutError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.TimeoutError "(in Python v3.9)") for you in case of timeout and is provided for ease of use.
In case the event returns multiple arguments, a [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.9)") containing those arguments is returned instead. Please check the [documentation](https://discordpy.readthedocs.io/en/master/api.html#discord-api-events) for a list of events and their parameters.
This function returns the **first event that meets the requirements**...
What can I use with .send in an on_ready().
Yesn't
?
You could but don't recommend it.
I'm making where when the bot is alive it sends whats new.
How?
I recommend a new async function with wait_until_ready inside the constructor.
@pliant gulch ??????????????
!d discord.ext.commands.Bot.wait_until_ready
await wait_until_ready()```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Waits until the client’s internal cache is all ready.
And that will send my embed?
Once the bot is ready, you can send it yes. You’ll have to get the channel you want to send it in
No you need to subclass the bot and add that function to run in the constructor.
I don't use cogs.
No
Dam I thought I knew what I was talking about nvm
don’t listen to me
Just use discord.Client()
danny isn’t in here
So like this?
https://paste.pythondiscord.com/igipovejas.py
!documentation discord.Client
!docs discord.Client
class discord.Client(*, loop=None, **options)```
Represents a client connection that connects to Discord. This class is used to interact with the Discord WebSocket and API.
A number of options can be passed to the [`Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client").
Use this @cloud dawn
No...?? What are you talking about?
What
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.
Bad
What lol
Freecodecamp told me discord.Client is better.
Than that shitty discord.ext.commands.Bot.
I said help, now I'm confused.
It’s preference. I don’t think it really matters
Not prefrence.
Nah he is just trolling
@pliant gulch ????????????????????
unfortunate
where would i put await ctx.send(random.choice(energy))
?
What is wrong with this code?
https://paste.pythondiscord.com/igipovejas.py
Tfym where...
tfym tfim
um just under whatever you’re defining?
so like under where you’ve defined energy. Try there
I switched to that shtty discord.ext.commands.Bot and now I have this error
from discord import discord as pycord
import discord.ext.commands
client = discord.ext.commands.Bot(command_prefix="!")
@client.command()
async def client(self, ctx):
ctx.send("Hi")
client.run("my token")
```Pycord taught me this but there's some error
its
import pycord
from pycord.ext import commands
Ok
and no need for self since your not in a class
import pycord
from pycord.ext import commands
client = discord.ext.commands.Bot(command_prefix="!")
@client.command()
async def client(self, ctx):
ctx.send("Hi")
client.run("my token")
```Still an error
show
await it lol
good eye
import pycord
from pycord.ext import commands
client = discord.ext.commands.Bot(command_prefix="!")
@client.command()
async def client(self, ctx):
await ("Hi")
client.run("my token")
```Like this?
no
await ctx.send(“hi”)
await ctx.send()
since its a coro
import pycord.... > discord.ext.commands.Bot(command_prefix="!")
that to lol
import pycord
from pycord.ext import commands
client = pycord.Client(command_prefix="!")
@client.command()
async def client(self, ctx):
await ctx.send("Hi")
client.run("my token")
```Like this?
no
your using the bot framework
Bruh I'll just use discord.Client since it's so troublesome
import pycord
from pycord.ext import commands
bot = commands.Bot(command_prefix="!")
@bot.command()
async def cat(self, ctx):
await ctx.send("Hi")
bot.run("my token")
!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.
lol
I’m having a hard time deciding if this is troll or not 
wtf...
Same.
same here
@slate swan dont name your function 'client'
probably copied from a tutorial
nah thats horrible to be a tutorial
LOL
@slate swan Not if it is him lmao Freecodecamp
Screw this... I give up
You can't just learn to code in a day or 2.
cap
Tutorials are fundamentally flawed in concept when it comes to teaching you something like a programming language. The simple reason for this is a programming language is how you create whatever you want, a tutorial is something that teaches you how to do *what the tutorial is teaching. *
I recommend reading through all of these points if you want to understand why
A couple of points against tutorials...especially video tutorials:
-
Tutorials teach you how to create a project, a specific program, a specific script, etc. This causes many many people to only know how to do this one specific thing.
-
A programming language is an entire language itself, this is obvious in of itself but for this point think of this compared to a real language...people have accents, there's multiple ways to say the same thing, there's multiple pronunciations for some words. This same kind of concept applies to programming languages, there are many ways to achieve the same thing, there are code styles which people pick up from learning. Sometimes...these practices can be bad and if you're just learning, how would you know if the tutorial is using some bad practice? Trust me...this happens **a lot **
-
Tutorials are made for that specific version of whatever it's using...whether this be python, the discord.py library, some other library it's using...etc. As time goes on that can very quickly become outdated
-
Sometimes there are "advanced" or hard concepts that are covered in a tutorial, you're not guaranteed to understand all of it right off the bat. It is extremely hard to provide the relevant documentation for every single concept covered....there would be so much.
-
Specifically for this library, the people who look for tutorials are typically new to the language...this library is not meant for beginners, there are some advanced concepts (EG asyncio) that are covered, and jumping straight into that as a beginner is very bad.
@slate swan ^
It is not handy to name it client since that has a different meaning.
explanation:
tutorials teach you only syntax
Pretty sure bad naming is part of the syntax lol
command ideas?
And the fact that making the function name client overwrites the defined client
Making client.run error
And in general making client not actually a discord.Client instance
True but if you are using commands.Bot you shouldn't run into that issue..
idk
You should still run into that issue if you had the same name though lol
and naming client your bot instance is a really bad idea
I recently was thinking about a anti command spam. That if you spam commands from the bot you get a global command cooldown.
Imagine naming everything a letter of the alphabet.
wouldnt that need a db to count how many commands in a certain time?
idrk how to start with that
just a dict is fine
Uh i'd use the RAM for that since it is really temporary.
Some people like discord.Client for servers who want the bot to feel more “human” ig. Without the prefix
oh yeah how do i set a global command cooldown (if someone spams x comamnds in more than y seconds)
probably
The command cooldown i do recommend a db though.
Sometimes you also don't need all that high level message parsing
Say if you had a bot only for logging, that would be a good use case of Client
Not if you were to have 50 message commands
count me out lol dont wanna use a db rn
True true
^
sql is boring to me ._.
sql i pretty fast and easy though
yeah but i got bored of it lol
anyone 
Or a regular dict
so any other command ideas
We kinda just told everyone here we are discussing it 
Write a compiler command
whats that
oh i didnt read 
turn code into machine language
You can just use on_command to get started.
to hard for me 😔
Hmm activity command.
pardon?
Make a command that creates sentences based on sentence structures and parts of sentences
Story creation!
Use the raw api to request a url to make a activity room like the new discord poker or youtube together.
autocomplete a sentence?
That’s not what I was talking about but sounds good too!!
Make a voice receive command
no i hate voice related stuff
still confused
Valid
Is youtube together even public?
Or is it still expirements
Otherwise I would've added to my wrapper already
No it is still experimental and highly rate limited.
guys i need a multimillion dollar idea😠
As expected
Still waiting on text field components
i think there's an api you can use cuz there's a ext lib for that already
Python syntax with the speed of js and that comes with an actual good api wrapper for discord.
!pypi discord-together
i have 0 knowledge on all of that🚶
Sounds like you need a 50 cent idea
Looks like they spend more time on the docstrings than the actual code.
sure
Yea, I know it exists but I'm asking if the endpoints are public
ohh
Make a command that picks a random image off like imgur
i have with asyncpraw
cute cute
Imgur != Reddit
Everything we recommend isn't good enough.
its still gets a random img ok
no i need to be bill gates
🕵️♂️
Try and see.
Emulate the Nswitch in the discord chat.
what is that😭
idk
🧍♂️
You asked for a million dollar idea you didn't say that it should be possible.
Make discord but in discord
🚶
Oh
I like where this is heading.
what😮💨
how😔
Ugh i actually hate that 😂
why
It's an apps marketing platform.
!ot I don't like being this guy.
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
Because... no ;-;
why?
🚶
we're talking about discord bot ideas
which is one of the topics
Isn’t these discord bot ideas?
Ah, then you're good. 
Yes this is very educational.
any command that uses buttons
calc
snake game in discord.
pardon?
make a really nice calculator
Rock Paper Scissors
I did everywhere i put i get a error
thats to generic
Heads up 7 up
oh calculator
mmhm
Get random wallpapers through some API, and make a "gallery" that you can go through using buttons.
Make a command that blends your pfp with pictures
i love this guy
dude
async def global_spam_ratelimit(ctx):
if ctx.author.id in self.owner_ids:
return True
bucket = self.cd.get_bucket(ctx.message)
retry_after = bucket.update_rate_limit()
if retry_after:
raise GlobalRatelimitHit('You have hit the global spam ratelimit!')
return True
```rn i have this but eh i want the owner to bypass this, for some reason it doesnt let me bypass the global cooldown
just make a calculator
Everywhere inside your command's function? Or everywhere in your code?
Everybody does. 

you want your commands to be unique? literally any fucking command you make you can find a website for online
oh snap 
¯_(ツ)_/¯
Make a gaslight command
you ask for command ideas but dont have the coding strength to implement them
@slate swan I found this API. https://unsplash.com/documentation#get-a-random-photo
Documentation for the world's most powerful free photo API.
Both
seen it lol i actually have a acc with it iirc
i do?i just dont want to do a calc? your own a device that probably has a calc so whats so hard to go into it and using it?
Make a command to start a minecraft server and have the console output inside the discord channel.
Make a turing complete calculator
Scientific calculator.
i will be making this bye now 🚶
Make a command… that makes new commands by editing your script 😌✌️
you can use the exact same logic for every single command every single bot has. you dont have the coding prowess to make any of the commands suggested, hence why you make the easy command.
It seems like you've got slight knowledge in Python. Nevertheless, your code should be like this:
@client.command()
@commands.guild_only()
async def energy(ctx: commands.Context):
energy = ["Heres 5 hour of energy",
"Heres one second of energy",
"Heres 10 hours of energy",
"Heres 24 hours of energy",
"Heres 1.5 hours of energy",
"Heres a week of energy",
"Heres 2 weeks of energy",
"Delete discord. Take a break"]
await ctx.send(random.choice(energy))
Remember, you need to import random initially.
my calc has that ;)
Unscientific calculator 🧍♂️
A calculator that just outputs random ints
Conversely, I do not recommend you rely on others giving you code. Better to learn Python before jumping into a complex library such as discord.py and rely on your own knowledge.
Make a bot that can create other discord bots
@slate swan These are a few small projects you can do to practice. https://knightlab.northwestern.edu/2014/06/05/five-mini-programming-projects-for-the-python-beginner/
not me starting discord.py with no code knowledge in 2019. It’s a miracle I still enjoy coding after that experience
Not hard tbh. Just create a new .py file, with open() and write the code in it. Then, use some sftp method to upload that file to your hosting.
I started coding python in May this year.
:O
impressive
I do that. I just execute !new <token> on my personal bot, and it creates a server on my Pterodactyl panel, sends link, and uploads the starting file to it.
Don't be fooled i was programming in PHP before this.
Pandas Hate Pink?
Noo ;-; i like pink
PHP more like Python (hython) python
php lol
just kidding ✌️🥵😔
!ot Don't try to convince me PHP has anything to do with dpy. 
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
you’re right
I mean i can use a PHP script to controll my dpy application.
im sure there are plenty of correlations
Has anyone seen a discord chat bot? That formulates it’s own responses?
You mean an AI?
It mostly gets responses through an API.
i wanna see a chatbot without py if bot.user: return 😎
Haha me too
Mmm gotcha
?Machine learning? but yeah ig
if you dont understand this then you shouldnt be here 
Machine learning is way too dumb dumb for that
I’ve been working on one that’s barely gone anywhere
But I’m working on it nonetheless
Machine learning is pure predictions and speculation trained based of on a model. AI can make real time adjustments to that module.
Quite the task, you need to tokenize things, weight tokens by how important they are. Then you gotta do all this nonsense with parsing
Gave it some categories like noun, verb, adjective, etc. taught it some words. Now it learns sentence structures by words it knows. It uses these sentence structures to decipher what a new word’s category is. Also have a check for surrounding word patterns to help assign new words.
Hit some roadblocks with English words falling in multiple categories but I’ve been working towards fixing that
As well as, it allows you to customize some information. Which's really cool. https://api-docs.pgamerx.com/AI Response/optional-customisation/#optional-query-parameters-for-full-customisation-in-the-ai
Are you taking into account intent and emotions as well?
First I’m getting a non-emotion version. Very blank
Afterwards I’ll work on connotations
I already have it where it can identify the subject and predicate and preposition in sentences (if it knows the words)
Training should be pretty simple too, depending on if you have an active discord server where the bot can listen onto
It’s a process 😤 too much brain power
Training is really simple. Problem is I let my activity slip in bigger servers during school so no one will add my bot lol
So are we talking about DNN?
No idea what that stands for
It’s using discord messages
Yeah using..? Keras? Tensorflow?
I made my own checks
It uses PyDictionary to remove words that aren’t words from my general check savefile
So you are saying you made your own neural network algorithm?
I’ve made a learning algorithm definitely not neural network
It uses averages of message structures and commonly used surrounding words
If that’s what you think an AI then sure lol
It’s not able to create a message based on subject yet because I will have to add some sort of connotation reader to create a message
Your reasoning about how you created your chatbot is beyond my comprehension.
I’m sorry I’m bad at explaining 😅 when it’s done ima open it up on GitHub
Your not using a neural network? This is gonna be hard to maintain
That is exactly what i was thinking, that's almost hard coding the thing.
Yeah I am aware but it’s kinda just a passtime thing
Most use neural network module with numpy to train and get responses.
Ima look into it. Tbf I didn’t really know what to look for
My first version of this process was trash and didn’t do crap because it was a fat else: statement at the end of my on_message because I didn’t understand functions in 2019
Well you start off with ANN then try to move on to DNN.
TensorFlow and keras do most of that heavy lifting though...
Now i want to do deep learning projects lol
It’s sm fun
i have 2 role commands that grant a user a role, one that gives and one that takes it away. i would like to make one role command and basically if the member doesn’t have the role it gives it to them but if they do have it, then it removes it. how could i make that possible? i need help please :)
From scratch it’s very satisfying watching it work
check if the user has that role yes or the no.
if it has the role.. remove else.. add
nono that’s not what i’m asking. i’m asking if i can make a command that can do both
Yeah so kinda like a light switch.
and so the command can detect if the user has the role or not and decide whether to remove it or to add it
That is exactly what my previous message suggested.
You can do that in one command. It’ll be like an if else
oh i didn’t understand it, my bad. i’m quite new to coding 😅
ohhh
Could you send the code you have got so far?
All good 🙏 gotta start somewhere
🙏

sorry for bothering but how can i make that command? 😅
alrighty
that's what they suggested 😛
here's the flow
- use the roles property on the discord.Member object, (docs:
discord.Member.roles) - check if the role object is in that list or not
- if it is, remove, if it isn't add
@bot.command()
async def addrole(ctx, role: discord.Role, user: discord.Member):
if ctx.author.guild_permissions.administrator:
embed = discord.Embed(description=f"Added {role.mention} to {user.mention}",color=0x2f3136)
await user.add_roles(role)
await ctx.send(embed=embed)
@bot.command()
async def removerole(ctx, role: discord.Role, user: discord.Member):
if ctx.author.guild_permissions.administrator:
embed = discord.Embed(description=f"Removed {role.mention} from {user.mention}",color=0x2f3136)
await user.remove_roles(role)
await ctx.send(embed=embed)
thank you!!!
!d discord.Member.roles
property roles: List[Role]```
A [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role") that the member belongs to. Note that the first element of this list is always the default [‘@everyone](mailto:'%40everyone)’ role.
These roles are sorted by their position in the role hierarchy.
btw is this part of a public bot?
no, this is a private bot for my server
okay cool
i am so sorry but i don’t understand how to do this 😭 i’m trying my best but how do i do this?
I'm coding...
nice!!
!e ```py
this is a demo of how you can check its in the list or not
roles = [0,1,2, 4,5]
we have 2
print(2 in roles)
we don't have 3
print(3 in roles)
@vast gale :white_check_mark: Your eval job has completed with return code 0.
001 | True
002 | False
ohhh thanks!
you can use that boolean logic to determine if you should use discord.Member.add_roles or discord.Member.remove_roles
Clean way you could do is (add_roles, remove_role)[role in member.roles]
import discord
from discord.ext.commands import Context, MemberConverter, RoleConverter
from discord.abc import Messageable
@bot.command(name='change_role', aliases=['cr'])
@commands.has_guild_permissions(administrator=True)
async def change_role(ctx: Context, role: RoleConverter = None, member: MemberConverter = None) -> discord.Message:
if not role and not isinstance(role, discord.Role):
return await ctx.send('Invalid role.')
member = ctx.author or member
embed = discord.Embed(description=f"Removed {role.mention} to {member.mention}", color=0x2f3136)
if role in member.roles:
await member.add_roles(role)
else:
await user.remove_roles(role)
return await ctx.send(embed=embed)
The return annotation is wrong kek
Idk what it returns lol
None or discord.Message
There xD
Any?
Could be any
(you have to import Any)
I did
and no, it'll be either discord.Message or None
from typing import Optional
# actual hint
Optional[discord.Message]
Well it isn't optional it will always return discord.Message now.
also you don't need to import the converters, discord.py will calculate those automatically
can just type hint them with discord.Role and discord.Member
Looks nicer imo
this is nicest
@bot.command()
@commands.has_permissions(administrator=True)
async def role(ctx: commands.Context, role: discord.Role, target: discord.Member) -> None:
meth = (member.add_roles(role), member.remove_role(role))[role in member.roles]
await meth
ye
Preference
that's valid syntax?
Which part
Sadly yes
meth as a variable 😭😭
ohhhhh okay lol
Meth as in ...
!e
a = (print(1), print)[1 + 1 == 2]
a(2)
ah i seee
@visual island :white_check_mark: Your eval job has completed with return code 0.
001 | 1
002 | 2
The person we were helping is long gone xD
hmm
Farewell panda
For backwards compatibility. True is really just 1 and False is really just 0
!e ```py
print(int(True))
print(int(False))
@pliant gulch :white_check_mark: Your eval job has completed with return code 0.
001 | 1
002 | 0
This is why (..., ...)[True] works along with False
hi how to make a discord modmail bot using python? thank you so much!
how do i make a cooldown for buttons do i disable it and then sleep and then enable it?
That should do the job, yes.
Wait wtf did u just do 
😶 py a = (None , None)[True]?
alr another question how can i append in a list comp if you can?
!e ```py
ret = (1, 2)[True]
print(ret)
@pliant gulch :white_check_mark: Your eval job has completed with return code 0.
2
how do i make it so a command can only be used by a specific role?
use has_role/has_any_role check
!d discord.ext.commands.has_role
@discord.ext.commands.has_role(item)```
A [`check()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check") that is added that checks if the member invoking the command has the role specified via the name or ID specified.
If a string is specified, you must give the exact name of the role, including caps and spelling.
If an integer is specified, you must give the exact snowflake ID of the role.
If the message is invoked in a private message context then the check will return `False`.
This check raises one of two special exceptions, [`MissingRole`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.MissingRole "discord.ext.commands.MissingRole") if the user is missing a role, or [`NoPrivateMessage`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.NoPrivateMessage "discord.ext.commands.NoPrivateMessage") if it is used in a private message. Both inherit from [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure").
Changed in version 1.1: Raise [`MissingRole`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.MissingRole "discord.ext.commands.MissingRole") or [`NoPrivateMessage`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.NoPrivateMessage "discord.ext.commands.NoPrivateMessage") instead of generic [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure")
@bot.command(discord.ext.commands.has_role(924841723753021490))
async def addrole(ctx, user: discord.Member, role: discord.Role):
embed = discord.Embed(description=f"**Added {role.mention} to {user.mention}**",color=0x2f3136)
await user.add_roles(role)
await ctx.send(embed=embed)
@bot.command(discord.ext.commands.has_role(924841723753021490))
async def removerole(ctx, user: discord.Member, role: discord.Role):
embed = discord.Embed(description=f"**Removed {role.mention} from {user.mention}**",color=0x2f3136)
await user.remove_roles(role)
await ctx.send(embed=embed)
is that correct?
bruh
you dont add the whole path to the check
and it's a decorator
oh
add it to your command
to your command
but like where or after what
above/below @bot.command()
alr
@bot.command()
@commands.has_role(role_id)
Still didn't understand
ty
We use the bool here as the index to access the tuple being (1, 2)
Since python 3 has backwards compatibility with python 2 True is actually 1 and False is actually 0

Ah
shit wrong person sorry
Cool
@maiden fable i found a reason for get_context
i have subclassed ctx and its very useful for me to have the ctx
ohhh, you're smart
I thought it was a new syntax or something
I got a pretty cleanly written bot
GitHub
A discord bot focused on clean code and utility. Using the discord.py library - GitHub - an-dyy/0x42: A discord bot focused on clean code and utility. Using the discord.py library
whats the coro to edit a msgs content
!d discord.Message.edit
await edit(content=..., embed=..., embeds=..., attachments=..., suppress=..., delete_after=None, allowed_mentions=..., view=...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Edits the message.
The content must be able to be transformed into a string via `str(content)`.
Changed in version 1.3: The `suppress` keyword-only parameter was added.
thx
Whats next? 0x43?
Yes
made with lefi right?
yeah ik you told me a while ago
Can someone help? This line is giving me errors.
@bot.command(name='8ball',
description="Answers a yes/no question.",
brief="Answers from the beyond.",
aliases=['eight_ball', 'eightball', '8-ball', '8ball'],
pass_context=True)
async def eight_ball(ctx, *argv):
if argv[0] == None or argv[0] == '':
possible_responses = [
'🎱 Totally no',
'🎱 Not looking likely',
'🎱 Too hard to tell',
'🎱 Quite possible',
'🎱 Definitely',
]
await ctx.channel.send(random.choice(possible_responses))
else:
await ctx.send("No proper arguments given")
And the errors are?
You never closed the string in the conditional
Close the string in the if @dreamy sluice
The single quotes?
And its ctx.send
Yes
both can be used
.channel gives error somtimes but oki as you want
no?
how does it give an error?
Aren't they already enclosed?
Can you show the full traceback?
@dreamy sluice may I know why have u left a line in between the deco and the function?
@maiden fable i've a question
Hm?
i have a question as well lol
Hm?
It produces an error?
Just asking... iirc it should error out, try removing the line
Ye lemme see
Does specifying a different name in the decorator and specifying a different one while initializing the function make any difference?
Welp, it still errors out.
@dreamy sluice try restarting your bot
@dreamy sluice u sure there ain't any missing closing brackets on preceding lines?
Hm
Sometimes the error is cz of a missing )
Screenshot of your code would be better
Pretty sure I didn't.
I might be dumb if I am being honest
Not even an error marking
Weird
if you edit an embed you only edit its text and not attachments right?
did you try restarting your bot?
is there any way to check if the author has either one of the permissions specified, and if they do, the command will run? ik how to use @commands.has_permissions(), but afaik it only checks for one permission
I re ran it several times.
Nope, iirc
Restart replit
k
has_any_permission is a thing iirc
Yes it is
how would i edit an img with the attachments kwarg in msg edit?
pycord allows editing attachments afaik
Wym edit an image?
That wasn't the question but okay
im trying to edit an embed that has an img in it and i want it to replace and img with a new one
make another embed then?
i did lol
just change the embed set_image or whatever your image is set in
i did
message.embeds return a list of Embeds object.
then edit the message with the new embed...?
U can do message.embeds[0].set_image(...)
kinda forgot and i think its wrong
whats the issue
still kinda unsure of what you're tryna do
@quick gust he's trying to edit an embed's image
await message.edit(content="text", embed=new_embed)```
await ctx.msgvar.edit(embedobj=newembedobj)
its wrong isnt it
No it isn't lol
why do you need context
gives me an error
Unresolved reference 'oldwallpaper'
pass_context is outdated isnt it
share your code
you should be able to solve that error
Yups
define oldwallpaper in your function, not in the global scope
But the power of **kwargs :DDD
im not that stupid
also embedobj isn't a kwarg i think
thats the old msg var

so whats the issue then
so? move it inside your function
hold up
how do you edit an embed because i did
oldembed=newembed
It showed them when I refreshed.
you need the message object, and the edit method takes an embed kwarg.
It has the same kwargs as send
@client.command()
async def act(ctx, arg, activity):
if ctx.author.id == 591047383044063244:
if arg.lower() == "playing":
await client.change_presence(activity=discord.Game(name=str(activity)))
await ctx.send(f"My activity has been changed to 'Playing {activity}'")
elif arg.lower() == "listening":
await client.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name=str(activity)))
await ctx.send(f"My activity has been changed to 'Listening to {activity}'")
elif arg.lower() == "streaming":
await client.change_presence(activity=discord.Streaming(name=str(activity), url="https://www.twitch.tv/sevendeadlywinds"))
await ctx.send(f"My activity has been changed to 'Streaming {activity}'")
elif arg.lower() == "watching":
await client.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name=str(activity)))
await ctx.send(f"My activity has been changed to 'Watching {activity}'")
else:
await ctx.send("Invalid Syntax Bozo")```
This is just giving me the `else:` back. Prior to adding `.lower()` it worked just fine. What did I do wrong?
yes i do have it so ill just use the embed kwarg and add the new embed
yes
What u inputting
Wym?
do you mind sharing what u are doing because the examples you are giving aren't helping us help you
the unbound error?
What are the arg and activity u putting
msgobj = await ctx.send()
await msgobj.edit()
im doing that which idk if its quite right
-act listening "Wind yell at me"
it is
weird
send() returns a Message object when you use it
That worked prior to me adding .lower()
Hmm
oof
thank you everyone
also u don't have a * operator so it will take "Wind as the activity only (not related to the error you are experiencing)
No
sorry im new to pycharm
The quotes make it take it all
so i turned off errors
oh they do?
Yeah
It will take the whole string @quick gust
VSC
good to know
i changed so i can have zero two in the background im that down bad
Although I should add a *, thx for reminding me
np
Wait so whats the difference between * and **
!args-kwargs
*args and **kwargs
These special parameters allow functions to take arbitrary amounts of positional and keyword arguments. The names args and kwargs are purely convention, and could be named any other valid variable name. The special functionality comes from the single and double asterisks (*). If both are used in a function signature, *args must appear before **kwargs.
Single asterisk
*args will ingest an arbitrary amount of positional arguments, and store it in a tuple. If there are parameters after *args in the parameter list with no default value, they will become required keyword arguments by default.
Double asterisk
**kwargs will ingest an arbitrary amount of keyword arguments, and store it in a dictionary. There can be no additional parameters after **kwargs in the parameter list.
Use cases
• Decorators (see !tags decorators)
• Inheritance (overriding methods)
• Future proofing (in the case of the first two bullet points, if the parameters change, your code won't break)
• Flexibility (writing functions that behave like dict() or print())
See !tags positional-keyword for information about positional and keyword arguments
hey
Ty
@slash.slash(
name="view",
description="select a country from a continent",
guild_ids=[877730319434919946])
async def view(ctx: SlashContext, args=None):
# north-america; Canada, USA, Mexico
dictionary = {
"north-america": [924737989341503609, 924737988800438322, 924737997503627265]
}```
?
so basically, im making a group of roles, per continent
and then i want to use a command (ex: !show-north-america)
and it will display the roles in North America that no one in the server currently has
this is a server specific command
elif args == "North America" or "NA23":
for country in dictionary["north-america"]:
guild = ctx.guild
role = discord.utils.get(guild.roles)
# role = get_role(country)
if len(role.members) == 0:
await ctx.send(role)
im not getting an error, however, its simply not working
can someone help?
thanks
Add print commands in various spots, it helps me sometimes
yeah
i still cant identify exactly why its not working
A member Cannot exist with 0 roles
if 0 members have that role
is what im trying to check
oh nvm I read it wrong , what r u trying to do btw
i have a dictionary, with roles. i want a user to invoke a command that sends every single role within that dictionary that no one in the server currently has
So is there a Utils.get with a guild parameter?
To check if anyone on the guild has the role?
if message.content.startswith.case_insensitive("$Hello"):
await message.channel.send("Hello!")
Would this allow for the bot to be case insensitive?
I have been stuck on case insensitive for awhile.
If you do py utils.get(guild.roles) all you get is the everyone role
In that case role.members will never be 0
is there a way around it?
Unless I did something that was like guild.roles minus one
Make it easier for yourself and actually use the commands framework thats built into the library
You want a role named something?
i got my bot to play music
commands.Bot takes allows you to pass case_insensitive into its constructer
No, I’m trying to cross check a dictionary which contains roles.
For each role in that dictionary that no one has, I want it to send the corresponding role ID
bot = commands.Bot(command_prefix="$", case_insensitive=True, description="The bot prefix is $.")
I have that but it isn't working.
how so?
You have role ids in the list , not roles....
Got any errors?
Those are the roles I want it to check tho
My bot (gets ratelimited?) Cannot add emotes after adding about ~30 emotes to an said guild, I've tried imposing and sleep statement in between addition of emotes like await asyncio.sleep(2) but that doesn't seem to help either.
How can i go about this?
wdym
a lego man has fallen into a river
I want it to check if anyone has those roles @slate swan and if not, send their IDS in the channel it was invoked in
Are you still trying to make commands with that
if message.content.startswith() shit?
if so, that makes sense why it wont work
you can just get the role using ctx.guild.get_role(id)and check if role.members is 0 or not
if you wanted to do it that way. Which no one here would recommend. You would convert the string to lower case .
For example:
if message.content.lower().startswith("!hello"):
await message.channel.send("hi")
Well what's the way you would do it?
They would tell you to read this guide
https://tutorial.vcokltfre.dev
A tutorial on how to use discord.py to create your own Discord bot in Python, written to fix the flaws of many other popular tutorials.
add parenthesis to lower
its a method
I honestly dont know why people who use dpy dont use the commands framework. Like its already built into the package you install from pypi or git. Unlike d.js's commando or akairo framework. Its honestly just wasteful.
Its like people trying to re-invent the wheel.
ill try this
it's the fault of bad/outdated tutorials
now im genuinely getting an error
elif args == "North America" or "NA23":
for country in dictionary["north-america"]:
role = ctx.guild.get_role(id)
if len(role.members) == 0:
await ctx.send(role)
What's the error
like my dict contains incorrect ids?
You should be using get_role(country) since that's the elements of list
ah yeah
no you coded it wrong
this makes sense, bc country refers to those ids
Yeah
No he didn't
ok
i havent seen this before, what does this entail?
!rule 7
7. Keep discussions relevant to the channel topic. Each channel's description tells you the topic.
is this java?
elif args == "North America" or "NA23":
for country in dictionary["north-america"]:
role = ctx.guild.get_role(country)
if len(role.members) == 0:
await ctx.send(role)
wdym
i updated the code tho
its py
can I see the dictionary variable
wat is this?
yeah
!rule 9
async def view(ctx: SlashContext, args=None):
# north-america; Canada, USA, Mexico
dictionary = {
"north-america": [924737989341503609, 924737988800438322, 924737997503627265]
}
mhm
!ot
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
hhe
What's so bad about that method?
role_ids : list = dictionary ["north-america"]
for role_id in role_ids:
role = ctx.guild.get_role(role_id)
``` try this
Read this #discord-bots message
Youll end up making it harder for yourself.
Take advantage of what you already have. Work smarter not harder.
So should I scrap some of my code and rebuild?
https://discordpy.readthedocs.io/en/stable/ext/commands/commands.html the proper way isn't any harder so it shouldn't be 2 difficult to replace the code
That would be ideal. So later in development you dont get inconvenienced.
this just returns another traceack exception
elif args == "North America" or "NA23":
role_ids : list = dictionary ["north-america"]
for role_id in role_ids:
role = ctx.guild.get_role(role_id)
if len(role.members) == 0:
await ctx.send(role)
so i use global last_level and the terminal says this, what's wrong
SyntaxError: name 'last_level' is used prior to global declaration
code:
@bot.command()
@commands.cooldown(1, 40, commands.BucketType.user)
async def exercise(ctx):
name = ctx.author.id
energy = database.check_energy(name)
coin = database.check_coin(name)
if coin > 50:
if energy > 20:
exp = random.randint(10, 50)
database.add_exp(name, int(exp))
last_level = database.check_level(name)
database.check(name)
level = database.check_level(name)
database.energy_decrease(name, 20)
database.decrease_coin(name, 50)
await ctx.send(f"{ctx.author.mention} is paying :money:50 to exercise, but {ctx.author.mention} getting {exp}XP!")
if last_level != level:
global last_level
last_level = level
await ctx.send(f"GG, {ctx.author.mention} is getting a level")
else:
await ctx.send("HEH u already tired, go sleep first (or u can use meal if u have one)")
else:
await ctx.send("not enough coin sorry :(")
Oh that's not related to the code I sent , you are .send()ing a role object
why are you using global 🤔
oh lmao, it works now
i have one more formatting question, and thanks for all your help btw
elif args == "North America" or "NA23":
role_ids : list = dictionary ["north-america"]
for role_id in role_ids:
role = ctx.guild.get_role(role_id)
if len(role.members) == 0:
await ctx.send(role.name)
right now its sending a separate message for each role
how can i make it send all of the role.name in one message?
this is probably pretty basic
remove it = local variable is declared before assignment, isn;t it?
list comps, then use str.join method on that list
yes, use botvar instead (see !botvar)
global is confusing
!botvar
Python allows you to set custom attributes to most objects, like your bot! By storing things as attributes of the bot object, you can access them anywhere you access your bot. In the discord.py library, these custom attributes are commonly known as "bot variables" and can be a lifesaver if your bot is divided into many different files. An example on how to use custom attributes on your bot is shown below:
bot = commands.Bot(command_prefix="!")
# Set an attribute on our bot
bot.test = "I am accessible everywhere!"
@bot.command()
async def get(ctx: commands.Context):
"""A command to get the current value of `test`."""
# Send what the test attribute is currently set to
await ctx.send(ctx.bot.test)
@bot.command()
async def setval(ctx: commands.Context, *, new_text: str):
"""A command to set a new value of `test`."""
# Here we change the attribute to what was specified in new_text
bot.test = new_text
This all applies to cogs as well! You can set attributes to self as you wish.
Be sure not to overwrite attributes discord.py uses, like cogs or users. Name your attributes carefully!
wdym by comps
List comprehensions
await ctx.send(", ".join([ctx.guild.get_role(id).name for id in role_ids if not len(ctx.guild.get_role(id).members)]))
Rough sketch but something like this
Wrote on mobile so theres probably a fault in there somewhere.
ok, ggty
this sends the message three times, as there are three values in the dict
is there a way to just make it send it once
Take it out of the for loop
rightt
everything in that list comprehension does all of that shit your for loop does
its still displaying roles within the dictionary that users have
i want it to only send the roles within the dictionary that no users have
elif args == "North America" or "NA23":
role_ids : list = dictionary ["north-america"]
for role_id in role_ids:
role = ctx.guild.get_role(role_id)
if len(role.members) == 0:
await ctx.send(", ".join([ctx.guild.get_role(id).name for id in role_ids if not len(ctx.guild.get_role(id).members)]))
here is the current code
Not sure why its still in your for loop but ok. Honestly that should of worked
.
if not ctx.guild.get_role(id).members works too
Remove the for loop entirely. The await ctx.send(....) should be right under the role_ids declaration
That elif condition will always be True
Got code that looks like this, and it's not working properly?
if x == "foo" or "bar" or "baz":
Python is interpreting this as though it was this:
if (x == "foo") or ("bar") or ("baz"):
If the first expression (x == "foo") isn't true, the second ("bar") will be, so this compound conditional always passes.
Try this instead: py if x == "foo" or x == "bar" or x == "baz": or, even better: ```py
if x in ("foo", "bar", "baz"):
Hi so im trying to make it play music but in a file it can play music out of the file but i want it to be in a music file
how do i do that?
i alr have the code
pass "music/file.mp3" in the arg then
so music/file.mp3 arg
?
put in the brackets obv
or just use FFmpegPCMAudio("music/"+arg) if all the music files are in the same directory named music
Just something to point out
!or
When checking if something is equal to one thing or another, you might think that this is possible:
if favorite_fruit == 'grapefruit' or 'lemon':
print("That's a weird favorite fruit to have.")
While this makes sense in English, it may not behave the way you would expect. In Python, you should have complete instructions on both sides of the logical operator.
So, if you want to check if something is equal to one thing or another, there are two common ways:
# Like this...
if favorite_fruit == 'grapefruit' or favorite_fruit == 'lemon':
print("That's a weird favorite fruit to have.")
# ...or like this.
if favorite_fruit in ('grapefruit', 'lemon'):
print("That's a weird favorite fruit to have.")
thank you for helping me btw
this helps simply the problem, however
the bot will still include IDs of roles that people already have
the goal is for the bot to only show the roles that people do no thave
is there any way to make a reconnect command? meaning the bot logs out then relogs in
using bot.close and os.system("python <your bot file>") may work
await ctx.send(f"@<{id}>, ".join([ctx.guild.get_role(id).name for id in role_ids if not len(ctx.guild.get_role(id).members)]))
can i use this to make it send the roles as pings, rather than names?
nvm, i tested it and i cant
can you explain how i can make it send the list as pings
From your code earlier
[ ctx.guild.get_role(role_id) for role_id in role_ids if not len(ctx.guild.get_role(role_id))]``` must be the thing
You can use.join on it
Is id a variable?
nope, so i cant do that
You want to mention the role?
yeah
",".join([ ctx.guild.get_role(role_id).mention for role_id in role_ids if not len(ctx.guild.get_role(role_id).members)])```
Role has mention attribute
never seen this error before
role_ids : list = dictionary ["north-america"]
await ctx.send(", ".join([ctx.guild.get_role(role_id).mention for role_id in role_ids if not ctx.guild.get_role(role_id)]))```
is it giving me an error bc it thinks that all of the roles are already occupied?
https://github.com/Shirataki2/discord-ext-audiorec
Can someone tell me why this doesn't record audio
GitHub
A discord.py experimental extension for audio recording - GitHub - Shirataki2/discord-ext-audiorec: A discord.py experimental extension for audio recording
It just sends recording like this one
"This project is currently under development. We do not guarantee it works."
thats what it says in its readme
BRUH
It works for my friend atleast
With the same code
not related to discord bots
And?
Ok so discord-interaction is a plugin to dpy so it is not related to discord bot?
Very dumb logic of yours
Bro this is not the dpy server
That should not be inside the loop....
oh nvm the list is empty
And use .members at the last , I forgot to add it
you only ask help here when its related to discord bots, the plugin worked didnt it? whats the issue lmfao #discord-bots message
Updated
The plugin didn't work
So?
the code works, except its still sending the roles which users within the server already have
"This project is currently under development. We do not guarantee it works."
make a issue on the github
for example, i have this role:
"The code works for my friend"
#discord-bots message
so?
but the message still contains it
Why is it not working for me
",".join([ ctx.guild.get_role(role_id).mention for role_id in role_ids if not len(ctx.guild.get_role(role_id).members) > 0])```
i mean it worked didnt it
it gave a wav file
!e py if len([]): print("works")
@slate swan :warning: Your eval job has completed with return code 0.
[No output]
yea it should work
The wav file is not the recording
its still displaying roles users have,
how can i make command that changes commands language cuz i dont wonna have problem with sameone who dont understanding polish sentensens sorry for my grammar spelling and english
has this ever happend to anyone?
yes, just wait it out
you got ratelimited and that mostly only happens with reddit users lol
reddit users
its a discord client
get ratelimited L
Do not use shared IP
?
?
Use kill 1 in shell
why?
And run again
you can get rate limited on any ide
a translater or aliases for a command?
it doesnt make a difference
It will kill the envoirenment and give you a new IP
ik but replit users mostly get for no reason cause of the shared ip addresses
okay why tho
OH THATS WHY
they just said why?
You got rate limited from the API

