#discord-bots
1 messages · Page 765 of 1
I hope he is.
for the lucas part , yes
for the hikari part , no
Understandable
I wish it was quite the opposite
i like lucas' voice
I don’t. Honestly if the people who are making hikari keep doing what they're doing it will be probably be better than dpy
True
Well, I'm kinda moving away from the bot making scene, soooo ain't learning hikari
hikari's naming is so uwu
I bet the owner's a weeb
Hikari isn’t as beginner friendly as dpy tho. Like I said it lacks many of the abstractions that dpy has.
That's a bold assumption to make.
hikari lover is typing...
well its developing fast
dav works on the hikari lib , lightbulb is maintained by thommo , tanjun by snab
and there are like 3 or 4 voice extensions
Like?
like lavasnek-rs , songbird-py
@cloud dawnif url1 == self.url: this was needed . ty
my purge command is not working for some reason it worked before
@bot.command()
@commands.has_permissions(manage_messages = True)
async def purge(ctx, ammmmount=int):
await ctx.channel.purge(limit=ammmmount)
ctx.guild -> ctx.get_guild() ( lightbulb)
Bot.get_user(id) -> GatewayBot.cache.get_user(id)
basically , the implementations are not too easy
tf is lightbulb
A commands framework
Weirdddd
They are easy... We are just adapted to dpy
How can I make banned words event? So it deletes the message + returns a message when banned word is detected?
comments on this ? hikari.impl.special_endpoints.ActionRowBuilder
Wait what's even that 😐
Hikari does stuff in a weird way as well.
In dpy Guild.members returns list[Member] while hikari's Guild.get_members returns a Mapping[Snowflake, hikari.Member]
What's smowflake here? The ID?
disnake.ui.ActionRow
Tf

Ye.
Check message.content of messages on on_message event
Same thing as
and we cannot disagree that all of the implementations really make sense
Wot
Yeah.
!d discord.abc.Snowflake
class discord.abc.Snowflake```
An ABC that details the common operations on a Discord model.
Almost all [Discord models](https://discordpy.readthedocs.io/en/master/api.html#discord-api-models) meet this abstract base class.
If you want to create a snowflake on your own, consider using [`Object`](https://discordpy.readthedocs.io/en/master/api.html#discord.Object "discord.Object").
What's action row
How to get an owner name in each server bot is in in cogs?
A row of components
What?
!d discord.Guild.owner
property owner: Optional[discord.member.Member]```
The member that owns the guild.
[g.owner for g in Bot.guilds]
Returns the owner of the server
Ez money
can you make it full ?
how do i make the bot delete the command after it has been sent/received
is it possible to use slash commands in cogs using disnake library?
Wdym?
Of course
I'm trying real hard to figure out where I'm failing
could you link me to some example or docu?
await ctx.message.delete()
How do I get it to delete that message and return another message?
What do you mean return another message?
Like print, "Your message was deleted bla bla bla"
You have too many syntax errors above first of all
And you can use the purge method on the channel
And the send afterwards
I don't know, can you make an example pls
Mk, thanks
await delete(*, delay=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Deletes the message.
Your own messages could be deleted without any proper permissions. However to delete other people’s messages, you need the [`manage_messages`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_messages "discord.Permissions.manage_messages") permission.
Changed in version 1.1: Added the new `delay` keyword-only parameter.
He means this line
await ctx.message.delete()
Yeah, purge is different, refers to bulk deleting messaging
print(bot.get_guild(guild id).owner)
Or you can of course fetch it
She*
Welp, yeah ;-;
Hold on, so what do I add now?
@slate swan am I doing this right
async def pug(inter):
await inter.response.send_message("Response")```
What do you think?
Cogs are classes
Cogs require a self argument to be passed as a parameter in all methods
await ctx.message.delete()
Tried that, says ctx isn't stated.
¸hmm ok
have you defined ctx?
what is your bot instance?
is it client or bot?
client
you sent two screenshots, one with bot and one with client
how did you define client?
I know I fixed it lol
Not sure what you mean by that uh-
client = ?
did you do client = commands.Bot(...)
Integer = "3" 
I asked what he did, how is that relevant?
how about both
await message.channel.send("deleting message")
await message.delete()
Hot
a client for making events
and a bot for making commands
You have to think about it
seems a cool idea
think about what?
then i can run both instances together
!pypi hikari
oof, how you so big brain lol
i watch many tutorials and combine them all to make a big latest bot
unofficial API or a wrapper? 
How to get all name of all member in each server is bot is in???
some of them use bot , some of them use client
so i used both to make a best one
I'm not even commenting on that
its a wrapper
!d discord.Guild.members i suppose?
property members: List[discord.member.Member]```
A list of members that belong to this guild.
Sorry again! Can you show me the example pls :(
I can write the whole bot for you then 🙃
Apply brain
@slate swan ah ok, the reason why my command didn't show up was because it was global. I've turned on debug mode and noticed "it might take up to 1 hour" message so I've just set it to local
@spring flax@slate swan
now everything works
Just let show me the example of that one pls :)
Yup
Get the guild and use .members on it, no more spoonfeeding
the initial owner named it that way ig
`An opinionated, static typed Discord microframework for Python3 and asyncio that supports Discord's V8 REST API and Gateway.
Built on good intentions and the hope that it will be extendable and reusable, rather than an obstacle for future development.
Python 3.8, 3.9 and 3.10 are currently supported.` is the actual desc
Umm.....? Ping diabolical they asked for it
@spring flax
I-
I see, tysm
!d discord.ext.commands.CommandOnCooldown
exception discord.ext.commands.CommandOnCooldown(cooldown, retry_after, type)```
Exception raised when the command being invoked is on cooldown.
This inherits from [`CommandError`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CommandError "discord.ext.commands.CommandError")
yo can someone help me
do await message.delete() and await message.channel.send(...)
Believe it or not. The guy who made it is 16
Damn
dav or nekokatt?
dav
He knows his way. 
are you new to python? Just asking
I am,
sorry for maybe asking stupid shit, lol.
Yes, can you teach?
!resources Alright so....making a discord bot requires some basic understanding of python.
If you do have a basic understanding it'd be a lot easier for you and you would know somewhat what to do and how
So I suggest going over the resources page here
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
smh
hey i have this code but i get this error ```python
role_id = str(config['staffid'])
role = get(guild.roles, id=role_id)
``` role = get(guild.roles, id=role_id)
AttributeError: 'int' object has no attribute 'roles'```
Nice- bt can you let me finish this command 😂
event*
Remove the parenthesis and try again
I didn’t really read your code. I’m just addressing your error.
Whatever guild is. It’s not an instance of discord.Guild. You probably have an id or something.
I can...but I'm only trying to make it easier for you
remove the parenthesis for @client.event()
Hi, just wanted to tell you that I tried this again & it worked! Thanks!
great , youre welcome ! :3
Oky, but how do I make it so it works when in message like "you are idiot" not just when u say "idiot"? @spring flax
if "idiot" in message.content
guild = int(config['guild'])
role_id = str(config['staffid'])
role = get(guild.roles, id=role_id)
me = "idiot"
if me in message.content: pass
Lmao
Get may always not work, it may return None
Sometimes
Which it usually doesn’t. All of the bots guilds are chunked on startup.
Oh wait
That’s a role
Same concept tho. Roles are cached as well. Guild.get_role() will always return something unless the role isn’t in that guild or doesn’t exist.
or you dont mess with the intents
many people just end up with only member intents lol
either way, he shouldn’t use utils.get() if he already has an id
You never grabbed the guild from cache
You just grabbed an id from your config and assumed that is your guild object
grab the guild with
Bot.get_guild() and consider adding the changes I just mentioned earlier.
what r u trying to do?
ah
ill assume you're watching swas.py?
use pfp.size where u used asset.size
same thing there too
replace asset with pfp
For some reason, my just broke. Doesn't respond on any commands + isn't showing any errors?
Huh.
Help?
you overwritten your on_message event
So your bots no longer processing commands anymore
Huh? What should I change
Add await bot.process_commands(message)
Where exactly?
I just said not in the if block
AH
Okay, lol. Also, how can I add more words?
Should I use like
if "idiot;lasagna" in message.content:
Or?
How do I add this list?
You're telling me you don’t know how to make a list??
uh-
I don't know how to separate words
well I forgot
space button
I'm trying to have a db with Mongodb using pymongo. Currently I'm trying to add a new field to a doc that's registered to that server but in my code I get '(' '[' and '{' not closed even tho they are. I'll send the code In a sec
!d discord.VoiceChannel.connect
await connect(*, timeout=60.0, reconnect=True, cls=<class 'discord.voice_client.VoiceClient'>)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Connects to voice and creates a [`VoiceClient`](https://discordpy.readthedocs.io/en/master/api.html#discord.VoiceClient "discord.VoiceClient") to establish your connection to the voice server.
This requires [`Intents.voice_states`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.voice_states "discord.Intents.voice_states").
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
Can you help then?
I will, but let me finish this.
Please.
gotta learn the priorities
!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.")
Your first if statement is wrong.
When deleting a message you don't need to pass an argument such as 5.
If you want to delete the bot message after 5 seconds, use the following
await ctx.send(..., delete_after=5.0)
If you want to mention the member, you can simply use message.author.mention.
That should be everything you need ^^
No problem :)
The last line is not correctly aligned with the if.
role = '934115503973203978'
@client.command()
@commands.has_permissions(administrator=True)
async def whitelist(ctx, user: discord.Member):
roles = ctx.guild.get_role(role)
await user.add_roles(roles)
roleadd = discord.Embed(color=0x800080,
title=":Tick: Role Given!!",
description=f'''
**Whitelisted** {user.mention}
**Whitelisted By:** {ctx.author.mention}
''')
roleadd.set_thumbnail(url=user.avatar_url)
await ctx.send(embed=roleadd)
await user.add_roles(roles)
File "C:\Users\siyya\AppData\Roaming\Python\Python310\site-packages\discord\member.py", line 777, in add_roles
await req(guild_id, user_id, role.id, reason=reason)
AttributeError: 'NoneType' object has no attribute 'id'
roles is None
IDs are integers, not strings.
Ah good catch
..?
Needs to be aligned at the same level as the if above.
!indention
Indentation
Indentation is leading whitespace (spaces and tabs) at the beginning of a line of code. In the case of Python, they are used to determine the grouping of statements.
Spaces should be preferred over tabs. To be clear, this is in reference to the character itself, not the keys on a keyboard. Your editor/IDE should be configured to insert spaces when the TAB key is pressed. The amount of spaces should be a multiple of 4, except optionally in the case of continuation lines.
Example
def foo():
bar = 'baz' # indented one level
if bar == 'baz':
print('ham') # indented two levels
return bar # indented one level
The first line is not indented. The next two lines are indented to be inside of the function definition. They will only run when the function is called. The fourth line is indented to be inside the if statement, and will only run if the if statement evaluates to True. The fifth and last line is like the 2nd and 3rd and will always run when the function is called. It effectively closes the if statement above as no more lines can be inside the if statement below that line.
Indentation is used after:
1. Compound statements (eg. if, while, for, try, with, def, class, and their counterparts)
2. Continuation lines
More Info
1. Indentation style guide
2. Tabs or Spaces?
3. Official docs on indentation
!indents
ha
Same as the return in the example above.
I believe it was-
Which you still have in that last screenshot by the way.
Also in the gamecode func why did you define embed and then again?
Ok well I have problem-
bot going crazy spamming it and deleting its own messages and mentioning himself
loop huh?
You need to ignore bot users.
Ah,
ctx.author.bot returns a boolean whether or not the author is a bot.
Simple if statement and then go for a return if it's true.
if ctx.author.bot = True
return
You can remove the = True
or - Im sorry, Im still pretty new,
Since it already returns a boolean
if ctx.author.bot:
would turn into
if True:
#or
if False:
So no need of a comparison.
I highly recommend learning the basics of Python first before coding a Discord bot.
So how do I add an ignore part
Im trying.
Lol.
It's a functions so simply return it
Simple if statement as above, then return
So we're asking these questions
Hey bro are you a bot? (yeah i am because ctx.author.bot is true):
Go back
How're you so funny
ctx isnt defined?
How should I define it
He can solve this one
Believe in me
You can't, at least not in an on_message
cries in python
So in the on_message function what are we passing in it?
Uhh
Take a look at the documentation for on_message and see what attributes a discord.Message has
event?
pat pat
No the args
can someone help
..
Well? What are we passing as an arg?
that does not work
Do not ask to ask ;-;
if it's bot?
No, what arg are you passing inside the function.
Please don't bump messages.
I have no fucking idea im not that smart smh
bump?
If Im smart I wouldnt be here
That code.....is so cursed
Add py after the three backticks please
It's not syntax highlighted 
kk
Okay you are passing message, so that is the object you should use. Not ctx
FINALYL
ong
@bot.event
async def on_member_join(ctx):
embed=discord.Embed(title="{memmerrb} joined the server Make sure to say welcome in the chat")
embed.set_image(url = "https://cdn.discordapp.com/attachments/929026308007161876/934116441328848946/ezgif-5-a319dff6e7.gif")
await buttons.send(
content = None,
embed = embed,
channel = ctx.channel.id,
components = [
ActionRow([
Button(
style = ButtonType().Link,
label = "Grab Some Roles",
url = f"https://discord.com/channels/932909416481689620/933800545230131220"
)
])
]
)
there
Dan Dan
I just asked you not to bump messages?
you formatted it like that cause it becomes longer , right?
r. danny died :(
Damn that actually makes sense
someone said i should add the py
It isnt here
Never was in this server lol this is not discord.py
Ah forgot this wasn't dpy
Dpy server has it
after the backticks
!d discord.on_member_join || we dont have rdanny here
discord.on_member_join(member)``````py
discord.on_member_remove(member)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") leaves or joins a [`Guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild "discord.Guild").
This requires [`Intents.members`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.members "discord.Intents.members") to be enabled.
Take a look at the args for on_member_join
well we got a problem
You have a lot of faults in your code ;-;
oh
now it doesn't even look at if has shit, it deletes and returns a message to any message you send @cloud dawn
yh i forgot
I literally said hi and it deleted
The way you declare the button gives me brain aneurysms
Send me the code
Eh? Try putting the words in a list
@bot.event
async def on_member_join(member):
embed=discord.Embed(title="{memmerrb} joined the server Make sure to say welcome in the chat")
embed.set_image(url = "https://cdn.discordapp.com/attachments/929026308007161876/934116441328848946/ezgif-5-a319dff6e7.gif")
await buttons.send(
content = None,
embed = embed,
channel = ctx.channel.id,
components = [
ActionRow([
Button(
style = ButtonType().Link,
label = "Grab Some Roles",
url = f"https://discord.com/channels/932909416481689620/933800545230131220"
)
])
]
)
Bro
Replit-
hi
Stop bumping the message next time i'm reporting it
BRO
Keyword: IndentationError
Ashley Ashley
@cloud dawn
!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.")
Can you please stop?
I used or?
fym what did i do
Hm-
Right, take a look at this: https://github.com/Rapptz/discord.py/blob/master/examples/views/link.py
Your code is ridiculously unreadable
Read it trough then you can see why it gets triggered.
I'd recommend opening up a help channel, there are many issues your code has
and how do i do that
No
This is the wrong usage of the or operator.
!e py print(bool('idiot'))
@quaint scaffold :warning: Your eval job has completed with return code 0.
[No output]
!e ```py
print(bool('false'))
@cloud dawn :white_check_mark: Your eval job has completed with return code 0.
True
!e ```py
message = "Hello you are looking good :D"
if "idiot" or "mf" in message:
print("The **** you say to me you little *****")
@cloud dawn :white_check_mark: Your eval job has completed with return code 0.
The **** you say to me you little *****
has anyone done subclass to bot?
how did you misspell shit
Yes
no whats that
That's not shit
the fuck you say to me you little shit?
I sent dm to u but u ignored me 😦
There are many words in the English language comprised of 5 characters
maybe dont dm 
But I don't have message bruh
its a phrase
It can be
anyway ```py
class anna(commands.Bot):
def init(self, *args, **kwargs):
super().init(command_prefix=commands.when_mentioned_or(command_prefix), *args, **kwargs)
self.uptime = int(round(time.time()))
dont mind indentations
bot.uptime
@cloud dawn
@client.event
async def on_message(message):
if message.author.bot:
return
if "idiot" or "mf" in message.content:
await message.delete()
await message.channel.send(f"Hey {message.author.mention}! Please refer using words like this one!", delete_after=5.0)
await client.process_commands(message)```
So what I change?
I did but I don't understand
what I did wrong
nvm lol
I found out haha
@client.event
async def on_message(message):
if message.author.bot:
return
if any([word for word in message.content if word in ("mf", "idiot")]):
await message.delete()
await message.channel.send(f"Hey {message.author.mention}! Please refer using words like this one!", delete_after=5.0)
await client.process_commands(message)```
So smart right? 🆒
is nobody gonna tell me im smart? smh
good attempt
.
users will always bypass censoring, but you can censor basic words, yeah...
@modern fibermaybe consider check message.content.lower()
^ and eventually once you get good enough you can use regex
someone helped me with a good censor (enough) but a girl with greek N bypassed my nwords fitlers 😦
I know haha, Im smart
@client.event
async def on_message(message):
if message.author.bot:
return
if words := [word for word in message.content.split() if word.lower() in ("mf", "idiot")]:
await message.delete()
await message.channel.send(f"Hey {message.author.mention}! Please refer using words like this: {''.join(words)}", delete_after=5.0)
await client.process_commands(message)```
not worth it, like bruh
this is an example of the regex of the n word
(?i)\bn[i1][bg]{1,2}[ae3][rs]?s?
Here's a better one: (?P<main>(?:(?:(?<!s)[n\U0001F1F3]+(?:(?P<_nc>.)(?P=_nc)*)?[i1!|l\U0001f1ee]+(?:(?P<_ic>.)(?P=_ic)*)?[g9\U0001F1EC](?:(?P<_gc>.)(?P=_gc)*)?)|(?:[k\U0001f1f0]+(?:(?P<_knc>.)(?P=_knc)*)?[n\U0001F1F3]+(?:(?P<_nnc>.)(?P=_nnc)*)?[e3€£ÉÈëeÊêËéE\U0001f1ea]+(?:(?P<_enc>.)(?P=_enc)*)?[e3€£ÉÈëeÊêËéE\U0001f1ea]+(?:(?P<_enc_>.)(?P=_enc_)*)?))[g9\U0001F1EC]+(?:(?P<_gc_>.)(?P=_gc_)*)?(?:[e3€£ÉÈëeÊêËéE\U0001f1ea]+(?:(?P<_ec>.)(?P=_ec)*)?[r\U0001F1F7]+|(?P<soft>[a\U0001F1E6])))((?:(?P<_rc>.)(?P=_rc)*)?[s5]+)?(?!rd)
gotta love the headache u get from regex 😄
i have a question. i am storing IP and port in a json file. i am fetching the names of the server from those ip and on what position/index they are in the json. how can i reverse the thing and get the server ip and port from its index or the name?
start using a db
SQLite / Postgres is what most recommend
you're clearly not using the json as a config (for it's intended purpose)
It's good for beginners but lacks more advanced features
well u just heard his simple issue 😄
for what it's worth, most beginners don't use the "advanced features"
ctx.channel.send(embed = random.choice(begEM)) this right?
i mean most dosnt know sql at all, and just do simple select can be hard first time
"another language to learn FUCk i give up, i stay with json" 😛
yup, if your begEM is a LIST of embeds
Everyone starts like that
Then you just need to to learn how to convert your json to sql tables
@potent speari learned basic sql before json was even a thing 😄
any way to reloads cogs on the fly so I don't have to restart bot every time? Using disnake lib
php+mysql
noice
webdevelop
yes
unload and load
not sure if u can change the code and unload n load tho? (never tested so i dont know)
yeah that's what I'm interested in, update the code on the fly without restarting the bot
try it out?
will do for sure
let me know 😉
alright :D
that would be great when working with 1 cog only
Code?
ye i literally have 1 cog only
but i guess i'll make admin cog for (re/un)loading
read whay I say please
begEM is an embed
Replying to your earlier problem, you can reload cogs to fulfil
I said IF begEM is a list, which it isn't
remove line 30
line 33 should be
await ctx.channel.send(embed = random.choice(list))
that's it
also, use a better variable name than list, it's reserved
call it embed_list or whatever
begEM = [em1, em2, em3, em4, em5, em6, em7, em8]
@bot.command(name='Beg')
async def Beg(ctx):
await ctx.channel.send(embed = random.choice(begEM))``` like so?
never played with that before
Perfect
ok let me try it
Hey how can i make my bot say somthing when a key word is sent?
i cant remember for some reason
that worked now i just have this issue the variables to say an amount doesn't work how do i make it work
hello guys i need help for discord.py
I did code on_message and now the commands do not work for me because of this, I tried to find a way to fix it but without success can anyone help me?
await bot.process_commands(message) at the end of the on_message
How do i get the list of perms the bot requires to execute a cmd?
can someone help me make a members command? like it shows the members of a specified role? also, shows the amount of people who have the role?
@bot.event
async def on_message(message):
if message.content == "test1":
await message.channel.send("test1", reference=message)
if message.content == "test2":
await message.channel.send("test2", reference=message)
if message.content == "test3":
await message.channel.send("test3", reference=message)
if message.content == "test4":
await message.channel.send("test4", reference=message)
if message.content == "test5":
await message.channel.send("test5", reference=message)
await bot.process_commands(message)
fetch the guild.members who has the role
@bot.command(name="timer")
async def countdown(self, ctx: commands.Context, number: int, reason: str):
if number < 0:
await ctx.send("Error: Input should be a number.")
elif number > 7201:
await ctx.send("Input must be under 7200 seconds")
else:
while number != 0:
number -= 1
await asyncio.sleep(1)
await ctx.send(f"{reason}")
hey how do i make it so my bot actually takes all of the {reason} and not just the first word
Still not working to write commands
example?
so if i do the command
$timer 3 reason 1 2 3
it will only take "reason" as its paramter for the {reason}
member.name for member in role.members
How do i get the list of perms the bot requires to execute a cmd?
bless you
how do i random pick a number for the {earning} varible in the embed prob with random choice but better safe than sorry
between like 10 and 50
!d random.randint
i need help someone ?
random.randint(a, b)```
Return a random integer *N* such that `a <= N <= b`. Alias for `randrange(a, b+1)`.
@echo wasp
What's your problem
.
can you show an example please the docs don't make sense to me
!e
import random
rand_num = random.randint(1, 10)
print(rand_num)
@final iron :white_check_mark: Your eval job has completed with return code 0.
6
What do you mean?
i think i know what he means
Randint chooses a number inbetween the 2 numbers you provided
ye
If you need to change the range just change the numbers
random.randint(<somenum>, <somenum>) is how it works i think
I just provided an example
¯\_(ツ)_/¯
Creating a Python string with your variables using the + operator can be difficult to write and read. F-strings (format-strings) make it easy to insert values into a string. If you put an f in front of the first quote, you can then put Python expressions between curly braces in the string.
>>> snake = "pythons"
>>> number = 21
>>> f"There are {number * 2} {snake} on the plane."
"There are 42 pythons on the plane."
Note that even when you include an expression that isn't a string, like number * 2, Python will convert it to a string for you.
oh i get it now
You just need to add an f at the beginning of your quotes
what's wrong
thanks
Move it outside the if
async def on_ready():
print('we have logged in as {0.user}'.format(client))```
use f-strings instead
That's not an f string
I know lol

Then why send it and say use an f string
"use f-strings instead"
Why not just provide an example of an f string
I was just highlighting their code which should be changed...
because you already showed them what f-strings are :)
What do you mean
it works fine
it works, but f-strings are better imo
i am helping someone so i will not just rewrite the code
fair enough
should i use API calls in the on_disconnect() event?
or should i avoid them like in the on_ready() event?
Api calls in on_ready makes your bot more prone to disconnectivity
drippy pfp
whats a api class?

Why this doesn't work?
I-
Am drunk, its clearly visible 
nvm I forgot comma
happens
yes in the value kwarg lol
requests as well can disconnect you from the api, discord doesnt like when you make a request or a call when the bot is connecting to the gateway
Welp
its an atoms action
main.py ```py
from disnake import Intents
from disnake.ext.commands import Bot
class SubClass(Bot):
def init(self, *args, **kwargs) -> None:
self.var = "Hello! I'm a bot variable!"
super().__init__(*args, **kwargs)
@classmethod
def create(cls) -> "SubClass":
""" Create and return an instance of a Bot """
return cls(
command_prefix="!",
help_command=None,
case_insensitive=True,
owner_ids=[169790484594556928],
intents=Intents.all()
)
@staticmethod
def load_ext() -> None:
bot.load_extension("cogs.acog")
async def on_ready(self) -> None:
print(f"I ({self.user.name}) am ready to rumble")
bot = SubClass.create()
if name == "main":
bot.load_ext()
bot.run("input-token-here", reconnect=True)
cogs/acog.pypy
from disnake import Message
from disnake.ext.commands import Cog, Context, command
from main import SubClass
class Acog(Cog, name="Acog"):
def init(self, bot: SubClass) -> None:
self.bot = bot
@command(name="tell")
async def tell(self, ctx: Context) -> Message:
return await ctx.send(self.bot.var)
def setup(bot: Acog) -> None:
""" Load the Acog cog """
bot.add_cog(Acog(bot))
More like it gets annoyed when it's doing something and u ask him to do a freaking job like changing status
yeah i love that example
Didn't want to overcomplicate it. I run it somewhere else as well.
It's me, when I'm coding and my mom asking me to do dishes
I know for a fact you just made that create method just to be cool
This is my __main__.py
from socket import gethostname, gethostbyname
from os import system
from core import Dispy, config, logger
bot = Dispy.create()
if __name__ == '__main__':
system('cls')
logger.info(f"Starting bot for {gethostname()} at {gethostbyname(gethostname())}")
bot.load_extensions()
logger.info(f"Attempting to connect to Discord..")
bot.run(config.bot.token, reconnect=True)
Rip
its me, when im coding and my mom tells me to turn off my pc when its been on for an hour
ew you make a class instance
ew
why learn classes and objects when u can just stackoverflow things
from NextGenbot import NextGen
if __name__ == "__main__":
NextGen().run()
my main files
My subclass is extremely minimal tbh. https://github.com/Yat-o/Kurisu/blob/structure_rewrite/src/kurisu/bot.py
I got this as well
Y'all seemingly use disnake
wuts this
from databases import Database
yes
A library
mhmm
Hikari lightbulb be like
ic
@unkempt canyon
Wait brb
import aiosqlite
from lightbulb.app import BotApp, when_mentioned_or
from lightbulb.checks import bot_has_guild_permissions
from hikari.intents import Intents
from .exts import initialise_databases, PrefixHandler
from hikari.permissions import Permissions
from datetime import datetime
class Winky(BotApp):
def __init__(self, token):
super().__init__(
token=token,
intents=Intents.ALL,
prefix=when_mentioned_or(PrefixHandler.prefix_getter),
)
initialise_databases()
self.boot_datetime = datetime.now()
self.load_extensions("lightbulb.ext.filament.exts.superuser")
self.load_extensions_from("winky/plugins")
self.check(
bot_has_guild_permissions(
Permissions.EMBED_LINKS,
Permissions.SEND_MESSAGES,
Permissions.ATTACH_FILES,
Permissions.READ_MESSAGE_HISTORY,
)
)
🐶
I hope thommo doesn't make lb 3.0 with completely another syntax
it's the 3rd time.im rewriting it
It’s like a combination of sqlalchemy and aiosqlite at the same time
But just made easy and wrapped
nice
sqlalchemy kinda hot ngl.
i wanna try hikari i just dont want to learn its syntax
why not?
Imo , it's somehow easier than dpy with lightbulb
just use lightbulb
lazy
smh
Or go hard mode and use tanjun. Tanjun is a lot harder compared to lightbulb.
It’s constant decorator chaining.
#cog like stuff
import lightbulb
plugin = lightbulb.Plugin(name="okimi" , description = "learn hikari when")
def load(bot: lightbulb.BotApp)
bot.add_plugin(plugin)

Even the slash Commands are too easy
!e
print("never")
@slate swan :white_check_mark: Your eval job has completed with return code 0.
never
@slate swan :white_check_mark: Your eval job has completed with return code 0.
do it
I'm used to jsk lol
We got this https://github.com/aoi-bot/Aoi/blob/task/69-info-migration/aoi/modules/message_commands/information.py
LOL
relatable
imagine using dpy and not Jishaku
cant be me
Tanjun doesn’t do function signature parsing. All the arguments need to be made with a decorator
Same goes for lightbulb
it’s kinda nasty tbh
Tanjun is a bit harder than lightbulb imo
Imagine having your username "Faster Speeding" and not being a pyromaniac
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
Hey, is there a way to delete that embed or just doesn't show it? I can delete it manualy because it's auto showing by discord. But i want bot to do it.
I mean if your bot doesn’t have embed_links it won’t show up
but how to do this because now it's only await ctx.send(...) or i misunderstanding
you're definitely misunderstanding.
ya maybe
embed_links is the permission that allows for people to have discord automatically embed their link
I have two snippets of code. The first one works as expected so i mimicked it to create the second one and the print statiment doesnt work. Any help?
@commands.Cog.listener()
async def on_ready(self):
'''Prints ready message in terminal upon bot connection as well as setting rich presence'''
print('Bot is online')
await self.bot.change_presence(
activity=discord.Activity(type=discord.ActivityType.listening,
name=' to your request | ..help')
)```
```py
@commands.Cog.listener()
async def on_member_join(self, member):
print(f'{member} has joined the server')```
So for example if your bot didn’t have that. Discord wouldn’t of embedded it for you.
Use <> at end front (opening) and the end (closing) of the urls/links
you're right because i checked and i gave him administrator so embeded links too
<https://welp.com/>
This works
and thats a good idea
i now how i works but didn't fought of it
so thanks
Thought? Or fought?
Welcome
I didn’t know that existed either 🤷♂️
thought*
Practical example of how much time I spend on discord

did you close the brackets?
Trying to make a try except. How do i address discord.ext.commands.MissingRequiredArgument?
you mean like, using a try/except to find if a param is missing?
Yes @quaint epoch
you want it to handle that exception
except discord.ext.commands.MissingRequiredArgument:
iirc
you should use py @bot.event async def on_command_error(ctx, error): await ctx.send(f'An error occurred: {error}')
depends
instead of putting try/except in every command

Had problem with @bot.event within my cog already
bc if you have to put it in every command it's just better to use the on_command_error event
your indentation
!indents
Indentation
Indentation is leading whitespace (spaces and tabs) at the beginning of a line of code. In the case of Python, they are used to determine the grouping of statements.
Spaces should be preferred over tabs. To be clear, this is in reference to the character itself, not the keys on a keyboard. Your editor/IDE should be configured to insert spaces when the TAB key is pressed. The amount of spaces should be a multiple of 4, except optionally in the case of continuation lines.
Example
def foo():
bar = 'baz' # indented one level
if bar == 'baz':
print('ham') # indented two levels
return bar # indented one level
The first line is not indented. The next two lines are indented to be inside of the function definition. They will only run when the function is called. The fourth line is indented to be inside the if statement, and will only run if the if statement evaluates to True. The fifth and last line is like the 2nd and 3rd and will always run when the function is called. It effectively closes the if statement above as no more lines can be inside the if statement below that line.
Indentation is used after:
1. Compound statements (eg. if, while, for, try, with, def, class, and their counterparts)
2. Continuation lines
More Info
1. Indentation style guide
2. Tabs or Spaces?
3. Official docs on indentation
Let me double check. Pretty sure i copy pasted though lol
You can't check a user's connections with dpy can you?
Yeah, my on_member_join command still doesnt work but on_ready does
!intents
Using intents in discord.py
Intents are a feature of Discord that tells the gateway exactly which events to send your bot. By default, discord.py has all intents enabled, except for the Members and Presences intents, which are needed for events such as on_member and to get members' statuses.
To enable one of these intents, you need to first go to the Discord developer portal, then to the bot page of your bot's application. Scroll down to the Privileged Gateway Intents section, then enable the intents that you need.
Next, in your bot you need to set the intents you want to connect with in the bot's constructor using the intents keyword argument, like this:
from discord import Intents
from discord.ext import commands
intents = Intents.default()
intents.members = True
bot = commands.Bot(command_prefix="!", intents=intents)
For more info about using intents, see the discord.py docs on intents, and for general information about them, see the Discord developer documentation on intents.
How would that translate to being used in a cog? Do i set up the bot line again?
no in your bot file
well darn. Was trying to have that within a cog for basic things like ping lol
Guys how can I make it so it deletes if someone spams
!d discord.TextChannel.purge
await purge(*, limit=100, check=..., before=None, after=None, around=None, oldest_first=False, bulk=True)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Purges a list of messages that meet the criteria given by the predicate `check`. If a `check` is not provided then all messages are deleted without discrimination.
You must have the [`manage_messages`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_messages "discord.Permissions.manage_messages") permission to delete messages even if they are your own. The [`read_message_history`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.read_message_history "discord.Permissions.read_message_history") permission is also needed to retrieve message history.
Examples
Deleting bot’s messages...
eh
What library are people using now instead of discord.py?
anything that does same thing as discord.py; interact with API,
like dpy forks, hikari, pincer and so on
Okay, I'll take a look into those
Was just curious as I've taken a long break from making bots and wondered if there was a fork/alternative that was most commonly used now
disnakw
everyone uses disnake
how can i get the guild icon/logo url?
not everyone
Nice one thanks, I'll take a look
master branch?
yes
as far as i remember its guild.icon.url, let me check docs
@slate swan You have opposition 
i use disnake but hikari is better tbh
For 2.0 or other forks
Welp
Ikrr
yeah he says he uses master
!d discord.Guild.icon
property icon: Optional[discord.asset.Asset]```
Returns the guild’s icon asset, if available.
replace guild with the guild instance you have
idk what that means...
ctx?
Eh? You okay?
yes
ctx.guild.icon.url
Code?
crazy how people dont know that ctx is context
disnake looks pretty good to me from a quick look
Any main reason you'd say hikari is better?
Just getting back into it so doing some research anyway
tyyyyyy
true
!d discord.ext.commands.Context.guild.icon.url
No documentation found for the requested symbol.
coughs
bru
just quicker that isnt a fork of dpy so overall its clean
and you wont make danny mad for using a fork
why even change ? dpy is usable as long as Gateway version 6 (if that is what dpy uses) and HTTP API version 8 isnt removed lmao
you really havent seen internals
i only seen http and gateway but i could be missing anything
Mostly because people want to use slash commands and upcoming form/user input methods without needing to install an add-on library for that.
hikari is just way cleaner compared to others
oh i see, makes sense
Why not switch to something maintained, dpy will eventually die, plus forks or other api wrappers hav better internals
i wasnt talking about any of that stuff tho
i doubt it will die
other wrappers will just takeover thats all
seems fine enough for me with personal bot that i dont plan getting it popular not even 10 guilds
At some point it will; at least not if they find another maintainer.
I meant, welp
you could still use a new fork, since its gonna be maintained and new methods would be added too
forks are just ctrl c ctrl v
Just a click, to quote it
i dont really care much about it being maintained or anything like that, just as long as it is usable, which dpy will be for while now
Not really no
Even if you edit a fork, it will still stay a fork
yes they do have new stuff but most forks connect the same way
Your choice, I'm no one to judge
same
disnake is a fork and will always be, as long as they don't make the library from scratch.
exactly
I dont see any point in making it from scratch tho ;-;
i do
A fork is just to make some changes that you'd like to see in the actual library.
some people are tired of trash forks
But keeping the base of that library.
i.e andy
Ouch, panda's lecturess
We switched to cutlery?
And personally I hate using forks.
wut
same here
i want to switch but im to lazy😔
Lmao, nothing, I was trying to make a bad joke
🚪⬅️
Yeah, I guess in this case though if no one is allowed to take over the original repo then a fork is the closest thing to someone maintaining the original 🤔
Yeah I read the whole post and that was deeeep, so it seems pretty unlikely
yeah same here
hoi... how can i fix this..? when I do !scrape it doesn't get the user ID's...
import discum
bot = discum.Client(token='bot token', log=False)
def close_after_fetching(resp, guild_id):
if bot.gateway.finishedMemberFetching(guild_id):
lenmembersfetched = len(bot.gateway.session.guild(guild_id).members) #this line is optional
print(str(lenmembersfetched)+' members fetched') #this line is optional
bot.gateway.removeCommand({'function': close_after_fetching, 'params': {'guild_id': guild_id}})
bot.gateway.close()
def get_members(guild_id, channel_id):
bot.gateway.fetchMembers(guild_id, channel_id, keep="all", wait=1) #get all user attributes, wait 1 second between requests
bot.gateway.command({'function': close_after_fetching, 'params': {'guild_id': guild_id}})
bot.gateway.run()
bot.gateway.resetSession() #saves 10 seconds when gateway is run again
return bot.gateway.session.guild(guild_id).members
@bot.gateway.command
def helloworld(resp):
if resp.event.ready_supplemental: #ready_supplemental is sent after ready
user = bot.gateway.session.user
print("Logged in as {}#{}".format(user['username'], user['discriminator']))
if resp.event.message:
m = resp.parsed.auto()
#print(m['content'])
if m['content'] == "!scrape":
#print("1")
guildID = m['guild_id'] if 'guild_id' in m else None #because DMs are technically channels too
channelID = m['channel_id']
userids = get_members(guildID, channelID)
print(guildID)
print(userids)
#with open("users.txt", "w") as userfile:
# userfile.write(userids)
bot.gateway.run(auto_reconnect=True)
there is module named discum ? what
My my, that import name
Lmao
!rule 5
5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.
Please leave.
whats inapropriate or against the law or anything here
It's selfbotting
its a self bot module
what...
against tos
Yeah sure
bro every time i ask help I get profiled for self botting
rip
then what are you doing?
Self botting? In the sense?
legit can u not get a bit of help like what the hell
A BOT
!pypi disnake ❤️
use a fork that actually is for bots
Basically creating a bot on a user account
A bot which registers all user's id's for the members cuz im working on a larger bot which uses oauth2 but needs the user id's in order to know the servers in common
like jesus mfing christ
Oh
Just use a lib not meant for self Botting then
wdym
Look, I'm just going to ping mods eventually
Solve your own problems if you dont know how to even communicate ;-; welp
Bai bai
That's your choice
hi korta
But its docs need a lot of improvement and I have seen its code too, some parts are well documented enough and there are a lot of methods that have very verbose documentation
yes
Although its still in alpha so
yeah
They are working on it
Although I absolutely love you can use plugins system with hikari
Very cool
yes indeed
I guess I'll use disnake for now since it's so close to what I was using before, and then I'll keep an eye on hikari because it could be interesting
Pincer actually looks more interesting than Hikari
pincer has way better presentation
Heard of Hikari some time ago and hasn't really moved away from the alpha stage as far as I know.
yeah both pincer and hikari look good
i have totally forgoten how to do this, so i feel dumb rn... but how do I send a message in a specified channel?
i dont use disnake
!d disnake.abc.Messageable.send ||
await send(content=None, *, tts=None, embed=None, embeds=None, file=None, files=None, stickers=None, delete_after=None, nonce=None, allowed_mentions=None, reference=None, ...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Sends a message to the destination with the content given.
The content must be a type that can convert to a string through `str(content)`. If the content is set to `None` (the default), then the `embed` parameter must be provided.
To upload a single file, the `file` parameter should be used with a single [`File`](https://docs.disnake.dev/en/latest/api.html#disnake.File "disnake.File") object. To upload multiple files, the `files` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.10)") of [`File`](https://docs.disnake.dev/en/latest/api.html#disnake.File "disnake.File") objects. **Specifying both parameters will lead to an exception**.
To upload a single embed, the `embed` parameter should be used with a single [`Embed`](https://docs.disnake.dev/en/latest/api.html#disnake.Embed "disnake.Embed") object. To upload multiple embeds, the `embeds` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.10)") of [`Embed`](https://docs.disnake.dev/en/latest/api.html#disnake.Embed "disnake.Embed") objects. **Specifying both parameters will lead to an exception**.
its the same for discord
you can grab a specific channel using utils.get
is there a function like asyncio.sleep that wont stop all the code?
provided you already have a Guild object
how do i do that...
you guessed it…asyncio.sleep 
but when I use asyncio.sleep it stops all the code after it too
or maybe im just lost
what do you want to stop
you'll need a discord.Guild object to do use discord.utils.get in this situation, do you have that?
i figured it out
ty!
¯_(ツ)_/¯
I want to give someone a role and send a message
But before this happens the bot should send a embed with the actual embed
I made it with many if statements maybe thats the problem
and I managed to solve the problem but I think it work better with something like asyncio.sleep
I can send the code if you want
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.
how would i go on to stop a bot on something like a timer, lets say i told the bot to make a timer, but i want it now to stop & clear the timer. (pls ping when replying to me)
It should just send the embed first and then add the role
I need it because when I dont send the embed first it will use the❌ everytime
wdym sniper bot?
From my understanding it's basically what the python bot does
If it can tell a bot token is valid it will delete it
I'm assuming he wants this except for crypto and it saves it instead of just deleting it
he's talking about crypto
Which is pretty inappropriate
no water that's really uh.. not how crypto works
I was assuming it was for account passwords and shit
I agree, I have no idea how crypto works
look, regardless
this isn't the place to ask about that, I'm unsure myself of how legal that is
take your questions somewhere else
out of context but is it possible to take a command name from a database?
Why not?
If it's in the database you can fetch it
yeah that's what i was thinking too i'll make something for user made custom commands
Hey! I'm trying to make my discord bot send a message in a channel ever n seconds (i chose 15) because it's supposed to be a type racer game.
however, I cannot get it to work.
@tasks.loop(seconds=15)
@ethan.event
async def type(message):
channel = ethan.get_channel(934185379790213190)
import random
from essential_generators import DocumentGenerator
gen = DocumentGenerator()
starttime = time.time()
answer = gen.sentence()
timer = 10.0
await channel.send(f"You have {timer} seconds to type: \n\n `{answer}`")
def is_correct(msg):
return msg.author==message.author
try:
guess = await ethan.wait_for('message', check=is_correct, timeout=timer)
except asyncio.TimeoutError:
embed=discord.Embed(title="Ran out of time! >:)", description="Have you ever tried getting good at actually typing? Here is what you can do to win:", color=0x109319)
embed.add_field(name="Tip 1:", value="Type the message exactly as provided. If you've left out punctuation, you will fail.", inline=False)
embed.add_field(name="Tip 2:", value="Don't Panic, if you panic, you'll most likely get it wrong", inline=True)
embed.add_field(name="Tip 3:", value="Be patient, don't rush the sentance or you will most likely fail.", inline=True)
embed.set_footer(text="Type racer game provided by Ethan Pelletier.")
return await channel.send(embed=embed)
# ctx.send("You took too long :(")
if guess.content == answer:
embed=discord.Embed(title="You Won! :DDD", description="Everyone who competed against you are complete losers.", color=0x109319)
fintime = time.time()
total = fintime - starttime
embed.add_field(name=f"{message.author.display_name} is the winner!", value="ahahaahahha this guy is a no life", inline=False)
embed.add_field(name=f"{message.author.display_name} typed out the message in a total of {round(total)} seconds.", value=":]", inline=False)
embed.set_footer(text="Type racer game provided by Ethan Pelletier.")
await channel.send(embed=embed)
else:
embed=discord.Embed(title="You lost! >:)", description="Have you ever tried getting good at actually typing? Here is what you can do to win:", color=0x109319)
embed.add_field(name=f"{message.author.display_name} is the loser!", value="ahahaahahha get good", inline=False)
embed.add_field(name="Tip 1:", value="Type the message exactly as provided. If you've left out punctuation, you will fail.", inline=False)
embed.add_field(name="Tip 2:", value="Don't Panic, if you panic, you'll most likely get it wrong", inline=True)
embed.add_field(name="Tip 3:", value="Be patient, don't rush the sentance or you will most likely fail.", inline=True)
embed.set_footer(text="Type racer game provided by Ethan Pelletier.")
await channel.send(embed=embed)
@type.before_loop
async def before_type():
await ethan.wait_until_ready()
type.start()
ethan.run(token)
I have to run the function outside of the function, but I also need to get the author's message to access the author name and such
I cannot define message when I'm calling the function from outside as message is supposed to get the discord user's message and you're not supposed to predefine it.
any help? haha
(don't worry about the name in the code, that information is very public and I don't mind)
why are you importing modules inside your task 
i was testing
ok
ok
yall able to help-?
I thought you fixed it
he was talking about the import
ok
Can you make a button to be pressed just by member member being the person you @ for the command on the old commands you could do this stuff with try except and wait_for , though i'm not sure if you can with slash commands and inter check
edit : it's possible
If you mean a help command you can subclass it
!d discord.ext.commands.Bot you can do help_command=None in there
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.
It's possible to get all users in a particular voice channel and return user objects for each correct?
Yes, a voice channel has a members attribute that returns a list of Member objects.
NO i mean help from staff
Can you provide an example?
Terrific, exactly as I expected 🙂
Is this going to be hardcoded for 1 server or for multiple?
I write the code, but people will use the command not the code
1 server
@final iron
You would create an embed, add a button on to it which creates a channel
If it fits your purposes make the button exclusive to the person who ran the command
Then make it exclusive to staff members only
Well, can you write me the code?
something called google
Because its a waste of my time and I'm not going to spoonfeed you
mem = (self.bot.get_guild(guild.id).members)
``` It show full information of members how to set up it for just show the name of the member?
It returns a list of member objects so you can just loop through the list and get the names with name
property name```
Equivalent to [`User.name`](https://discordpy.readthedocs.io/en/master/api.html#discord.User.name "discord.User.name")
can you make an example? I don't know :(
Which part?
Loop through the list or getting the name?
yes
get the name
It would be like getting the name normally where i is your member object
yes
yes what?
no

!e
a = range(1, 11)
for b in a:
print(b)
@slate swan :white_check_mark: Your eval job has completed with return code 0.
001 | 1
002 | 2
003 | 3
004 | 4
005 | 5
006 | 6
007 | 7
008 | 8
009 | 9
010 | 10
!e
a = ["CAPS","LOCK"]
for b in a:
print(b.lower())
@slate swan :white_check_mark: Your eval job has completed with return code 0.
001 | caps
002 | lock
see^
ok tks
or you can just add the list without a var which works as well
yw
Whats the rate limit on editing messages?
Isn't that kinda low?
not really
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
I have a serverinfo command and when I tried it, it gave me this error. If anyone here knows anything about hikari-lightbulb please help me
@plugin.command
@lightbulb.command(name="serverinfo", aliases=['server', 'si'], description="Displays info about the server")
@lightbulb.implements(lightbulb.PrefixCommand, lightbulb.SlashCommand)
async def cmd_guild_info(ctx: lightbulb.Context) -> None:
guild = await ctx.bot.d.redis_cache.get_guild(ctx.guild_id)
ms = guild.get_members()
cs = guild.get_channels()
guild_id = guild.id
await ctx.respond(
f"Created at: <t:{int(guild.created_at.timestamp())}:f>\n"
f"Owner: `{ctx.bot.cache.get_member(guild_id, guild.owner_id).display_name}`\n"
f"Verify level: `{str(guild.verification_level).title()}`\n"
f"ID: `{guild_id}`\nEmojis: `{len(guild.get_emojis())}`\nRoles: `{len(guild.get_roles())}`\n\n"
f"**Members**\nTotal: `{len(ms)}`\nHumans: `{len([m for m in ms.values() if not m.is_bot])}`\n"
f"Bots: `{len([m for m in ms.values() if m.is_bot])}`\n\n"
f"**Channels**\nVoice: `{len([c for c in cs.values() if c.type == hikari.ChannelType.GUILD_VOICE])}`\n"
f"NSFW: `{len([c for c in cs.values() if c.is_nsfw])}`\n"
f"Text: `{len([c for c in cs.values() if c.type == hikari.ChannelType.GUILD_TEXT])}`"
)```
how do i transfer from replit to vscode i cant leave replit help
Copy the code over
Not sure if there is an option to download the files
ctrl c moves mouse and creates a file ctrl v
Ayo okimii
huh
should i use cogs for each command? or category of commands
When you think of ram what do you think of?
is there a channel to talk about trading bots?
what categories
Because I got this command
random accessible memory
like moderation and others
But most people don't know how to recognize a dimm
51???????????? how much ram you have
LOL
16gb
same
what is your bot for
how many hz
Well it would be mhz
yes
Because if we're talking in hz it would be a very large number
how many
3200mhz😩
imagine you forgot to edit bios and youre running 2444mhz
I have docp enabled
good