#discord-bots
1 messages · Page 555 of 1
forgot about that lmao
yeah forgot about that
!d contextlib.redirect_stdout
contextlib.redirect_stdout(new_target)```
Context manager for temporarily redirecting [`sys.stdout`](https://docs.python.org/3/library/sys.html#sys.stdout "sys.stdout") to another file or file-like object.
This tool adds flexibility to existing functions or classes whose output is hardwired to stdout.
For example, the output of [`help()`](https://docs.python.org/3/library/functions.html#help "help") normally is sent to *sys.stdout*. You can capture that output in a string by redirecting the output to an [`io.StringIO`](https://docs.python.org/3/library/io.html#io.StringIO "io.StringIO") object. The replacement stream is returned from the `__enter__` method and so is available as the target of the [`with`](https://docs.python.org/3/reference/compound_stmts.html#with) statement:
```py
with redirect_stdout(io.StringIO()) as f:
help(pow)
s = f.getvalue()
``` To send the output of [`help()`](https://docs.python.org/3/library/functions.html#help "help") to a file on disk, redirect the output to a regular file...
@pliant gulch i did ```py
return 2 + 2
Can you show your code?
@commands.command(aliases=["e", "eval"])
async def evaluate(self, ctx, *, code):
codeblock = f"```{code}```"
end_code = codeblock.strip("`")
end_code = textwrap.indent(end_code, prefix="\t")
evaluated_result = exec(f"async def eval():\n{end_code}")
captured_errors = traceback.format_exc(limit=None, chain=True)
embed = discord.Embed()
embed.add_field(name="Code evaluation finished!", value=f"{evaluated_result}")
await ctx.send(embed=embed)
ah okay, and do ```py
eval(f"\n\t{code}")
okay so like this: py exec(f"def eval():\n\t{code}eval()")?
No
sorry, i'm just a bit confused.
Exec makes the eval function
So in your embed, separate from the exec
Call eval
Just replace where you have evaluated_result with await eval()
ah okay
so like this: ```py
evaluated_result = exec(f"async def eval():\n{end_code}")
embed.add_field(name="Code evaluation finished!", value=eval())
I would keep it in the f-string, and make sure to await eval
which website should i host my code (websites like heroku)
okay so ```py
await eval()
This is actually a really good solution for an eval command
Mhm
Personally I just sent the result to a txt file and sent the contents
And keeping it in the f string will cast the return to string when sending
So it won't error if you send something that can't be sent
ah okay
@pliant gulch it's saying that I can't pass nothing to eval()
Oh, rename eval to something else then
which website should i host my code (websites like heroku)
the eval() function, or my evaluated_result variable?
try something like docker
I'm trying to implement a search function into my bot, however when the command is called only the first word of the search is used. So for example if you search up "nice image", it will only search up "nice". How do I make it so the url parameter takes all the text after the command?
the name of it inside of the exec
and then call it with the name which you changed it to
ah okay
when I do this: ```py
evaluated_result = exec(f"async def eval_code():\n{end_code}")
embed.add_field(name="Code evaluation finished!", value=f"{await eval_code()}")
I'd just ignore it for now, does it work?
nope, it's saying that eval_code doesn't exist.
Ok, seems like you will have to make a dictionary then
damn okay
variables = {}
exec("eval_code function here", variables)
okay
then call it via await variables["eval_code"]()
in your embed
You can add variables to variables if you want, so you can do stuff like referencing ctx
okay, and should I define this dictionary before evaluated_result or in place of end_code?
Do it above the exec as I have done in the example
And you don't need evaluated_result
okay
ah okay
@pliant gulch god my brain is tired, why is this python formatting returning an error: ```py
value=f"{await variables"eval_code"})
you can't have double quotes inside of the double quotes
replace "eval_code" with 'eval_code'
what is it saying?
LMAO NVM
Does it work now?
no
when I use a codeblock, it's saying that this line of code: ```py
embed.add_field(name="Code evaluation finished!", value=f"{await variables'eval_code'}")
Strip it
can you send the full error
Same way you stripped the tilda's
should I also strip the tildas from it?
Yes
okay, let me give it a shot
embed.add_field(name="Code evaluation finished!", value=f"{await variables['eval_code']().strip('`')}")
``` coroutine object has no attribute 'strip'
@commands.command(aliases=["e", "eval"])
async def evaluate(self, ctx, *, code):
codeblock = f"```{code}```"
end_code = codeblock.strip("`")
end_code = textwrap.indent(end_code, prefix="\t")
variables = {}
evaluated_result = exec(f"async def eval_code():\n{end_code}", variables)
captured_errors = traceback.format_exc(limit=None, chain=True)
embed = discord.Embed()
embed.add_field(name="Code evaluation finished!", value=f"{await variables['eval_code']().strip('`')}")
await ctx.send(embed=embed)
which line from this code?
Above the second assignment of end_code
just do end_code.strip again but with py
Or you can do it on the first strip if you want to save lines
nah, i'll just do it before the second define statement
evaluated_result = exec(f"async def eval_code():\n{end_code}", variables)
``` now it's saying that this line contains invalid syntax, ``````py
Can you print out end_code and show me what that looks like
Why is there so many tildas?
Codeblocks should only have 6, 3 on top and 3 on the bottom
idk
Run the command with
return 2+2
that's what I've been doing though
What for?
idk, if I need help in the future, you seem really chill, that's all.
@pliant gulch alright, i'm going to head out now. You have more patience than jeff bezos has money in his bank account honestly. You are a legend, I really appreciate you sticking around for nearly 1:30 hours, thank you.
👍 , and I don't give out help in DM's if you want help from me just ping me
I will sometimes be able to help out
ah okay, I got it. Thank you again!
OH WAIT
hm?
OHHHH
Do all the stripping DIRECTLY on code
code? where is that?
the argument you pass to the command
embed.add_field(name="Code evaluation finished!", value=f"{await variables['eval_code']()}")
``` like this line?
async def evaluate(self, ctx, *, code):
code right here, do all the stripping on the code variable
Does anyone know an efficient way to store a mute duration if the bot were to restart?
ah okay, so I will just do ```py
async def evaluate(self, ctx, *, code.strip("`"))
no where the end_code stuff is
lol
just replace codeblock with code
OHHH
evaluated_result = exec(f"async def eval_code():\n{end_code}", variables)
``` now it's saying that this line has invalid syntax
strip py as well
from that line?
i dont think that's a good idea
And why not?
it'll strip anything that says "py" in the code too right?
It would but you can just avoid typing py in your codeblock
u could just do
👍
and make it strip that
???
like make it string the image i just showed u
The whole point of the strip("py") is to clean the codeblock
Yea, so if you don't strip it then it will error
but it'll strip anything that says py in the code like i said
Yea, and I said to just avoid typing py
breh
iirc you can't strip with more than one char, you might have to use removesuffix
you can
I just used splicing
!e ```py
a = "py-bruj"
print(a.strip("py"))
@pliant gulch :white_check_mark: Your eval job has completed with return code 0.
-bruj
!e
test = "test"
print(test.strip("t"))
print(test.strip("st"))
@brave vessel :white_check_mark: Your eval job has completed with return code 0.
001 | es
002 | e
not sure what that last one is doing lol
!e py test = "python" print(test)
@slate swan :white_check_mark: Your eval job has completed with return code 0.
python
ah, nvm
i think it can be a bit buggy tho since i remember running into an empty string with stripping, and that's why removesuffix /removeprefix was made i think
see how it doesnt remove py?
Whered the t go??????
Because you didn't strip...?
strip is apparently interpreted as a set of characters for when you give the string, and removes it from both ends, so s is removed from the end and t from the beginning
Ah that makes sense
!e
a = "py-brujyp"
print(a.strip("py"))
@brave vessel :white_check_mark: Your eval job has completed with return code 0.
-bruj
Yikes
Ig you could probably do some regex stuff or manually parse the string if you want something very consistent
i think str.removesuffix or str.removeprefix works too
!e
a = "py-brujyp"
print(a.removeprefix("py"))
@brave vessel :white_check_mark: Your eval job has completed with return code 0.
-brujyp
yea, removeprefix seems ideal this case
i have to say the behavior of strip confused me a lot lmao until i realized that it just doesn't work for substrings
quite annoying but there's probably a reason for it
@brave vessel Do you have any knowledge in concurrency stuff?
Barely, I'm mostly into asyncio but I'm somewhat of a beginner there
I've worked with threading before but I don't really use it, since it's not really my niche
Ah, darn I just finished impl a concurrent request ratelimit handler for my discord API wrapper
needed someone to review it
I mean I can try to understand it i suppose
where's it at?
Uhh let me push the code I have rn to the repo then I'll send you the link
client = discord.Client()
@client.event
async def on_ready():
general_channel = client.get_channel("id")
general_channel.send("Bot is online!")
Where would I put the await in this situation
await general_channel.send("Bot is online!")
Why is that
general_channel.send(...) is the 'coroutine function' (an asynchronous function TLDR)
and doing await will call that coroutine function
Both if you feel like it, the wrapper's main purpose is for clean written code as
I despise how the internals of dpy look
Alright, sounds good
Is client.get_channel("id") not a coroutine function?
Nope
Okay
I'll check it out
In the documentation, will it tell me what methods are coroutine functions?
Yep!
It's on a branch so I'll just open a PR rq
I might not be the best with logic considering I have heard of semaphores and the likes but haven't worked with them too much, so it'll mostly be logic with easier ways to do it in Python itself and maybe a few asynchronous comments if I understand it, is that fine?
I might try and do a bit of reading while reviewing so I can also make some comments on the concurrent handler
Alright, that is fine 👍
If you want to move to DM's that is alright as well since it might flood this chat
Oh yeah true
My dm's are off so you will have to add me if thats alright
channel_instance.id should be good
Wym
when I do get_channel(id)
it needs an id
Eeeeeeeek
How do I hardcode the ID
Copy the ID of the channel
and then copy and paste it into the argument of the ufnction
could anyone help me with this?
I don't have the option to
Ah thanks
np
wdym ask for it?
^ @pale zenith
make a command that asks the user for the ID/mention/whatever
and store it in a database
well actually
i dont even know what you you're trying to do in the first place
so idk if thats even what you'd want/need
you could have the user get the channel object like
.command #discord-bots
ok
client = discord.Client()
@client.event
async def on_ready():
general_channel = client.get_channel("id")
general_channel.send("Bot is online!")```
🤔 probably hard code the id is the easiest lol
IDs are int btw
(also for commands you probably want commands.Bot not discord.Client btw)
How can I check if anything from a list is in the content of a message
any takes an iterable^
see the 2nd to last example
Ok and in an on_message how could I use that
On message takes the param message rifht
so would message.content work
yep
Ok thanks
np
Does anyone know how I can tell how long it takes a user to answer a .wait_for()
anyone else using hikari now?
Lets say it took a user 4 seconds to respond. How would I get that value?
try:
message = await bot.wait_for("message", cheeck=check, timeout=10.00)
expect asyncio.TimeoutError:
await ctx.channel.send("Took to long")
else:
print("Do stuff")
You could use time.perf_counter before, use the wait_for, and then after subtract perf_counter() minus the value set to time.perf_counter and print it
The wait_for command won’t execute any code after it until it receives the event or times out
alright ill do that thanks
@client.event
async def on_message(ctx, message):
if urls in message.content:
await message.delete()
await ctx.send("server protected from phisher")
else:
return
client.process_commands(message)
What did I do wrong nothing works
is that a modded client
you don't need ctx
actually you can't have ctx for on_message
Anything else
so take out ctx and sintead put await message.channel.send()
it doesnt matter what name ur param is as long as theres only 1
yeah that's fair
Ok anything else
it should be good, you have the urls variable defined somewhere right
Mhm
then it should work
Everything else works but it doesn't do the deleting or sending no errors
hey there, actually I was trying to get some data using the lichess api, I was using the aiohttp lib, but when I ran the code it gave me a ssl error, whereas when I ran the same code using requests module and using Curl directly, it worked perfectly fine
import discord, aiohttp
import json
from discord.ext import commands
class lichess(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command()
async def lichess_profile(self, ctx, user):
try:
async with aiohttp.ClientSession() as session:
async with session.get(f'https://lichess.org/api/puzzle/daily') as json_data:
prof = json.loads(await json_data.text())
await ctx.send("something")
print(prof)
except Exception as e:
print(e)
def setup(client):
client.add_cog(lichess(client))
My error was this -
Cannot connect to host lichess.org:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1122)')]
whats wrong
I keep getting a ssl error
its a website problem ig
maybe, idk why it was working with Curl and requests
if urls is a list, then the code within that clause will never trigger
list in str will never be True
odd that it doesn't throw an error though
?
is urls a list?
No a string
ah ok
It says urls because I plan to make it ha ve several urls
in one string?
No
oh also your async def shouldn't be indented past the @client.event
Want me to explain my project shortly
no, it's okay
just make sure you aren't using the in keyword to compare things that never have a chance of being true
try de-indenting your entire function by one indent and see if that changes anything
hi is this where to ask question about problems of discord bots?
yes
The id of the sticker.
how do I get it in discord though
Traceback (most recent call last):
File "main.py", line 2, in <module>
import discord
ModuleNotFoundError: No module named 'discord'
KeyboardInterrupt
KeyboardInterrupt
!d discord.Message.stickers
A list of sticker items given to the message.
New in version 1.6.
download the module
what module?
Pip install discord
you're using the discord.py module but you haven't installed it?
i have it but that shows up
then install it first
python3 -m pip install discord
?
that's how to install if you want
more complete instructions can be found on the github page
It's not discord, its discord.py
If you looked at the pypi page you'd see that
https://pypi.org/project/discord/
Although it works ig
so i need to download an app?
Yeah.
this might be outdated
Tis why iim saying it aint the way
makes sense
Y'all got any idea how to set up a warning system, and after 3 warnings it auto mutes you?
check if the user has 3+ warnings when you warn them -> mute them
if user_message.lower() == '*specs':
embed = discord.Embed(title="Sunflower Duck's PC specs", url="https://www.youtube.com/watch?v=dQw4w9WgXcQ",
description="SSD: M.2 1000GB Hard Drive MOBO: B460M Pro Vdh Wifi GPU: Intel UHD 630 Case: H510 Elite RAM: 16GB CPU: Intel core i5 10400",
embed.add_field(name="Field 2 Title", value="It is inline with Field 3", inline=True,
embed.add_field(name="Field 3 Title", value="It is inline with Field 2", inline=True,
color=0xFF5733)
await message.channel.send(embed=embed)
return
position error
position error?
whats a position error
oh
wrong spacing
await message.channel.send(embed=embed)
^
SyntaxError: positional argument follows keyword argument
Can you show me your code & error
does anyone know how to make your discord bot stay awake?
Wdym stay awake?
i mean
i used some website for coding
but when i close the website, the bot also shutted down
Hey there, actually I was thinking to integrate mongodb in my discord.py bot, but just wanted to know, that if pymongo works asynchronously or not
Hi, I am trying to make a snipe command where it retrieves the last deleted message, here is the code so far, what is wrong with it?
@client.event
async def on_message_delete(message):
client.sniped_messages[message.guild.id] = (message.content, message.author, message.channel.name, message.create_at)
@client.command()
async def snipe(ctx):
contents, author, channel_name, time = client.sniped_messages[ctx.guild.id]
embed = discord.Embed(description=contents, colour=discord.Colour.blue(), timestamp = time)
embed.set_author(name=f"{author.name}#{author.discriminator}", icon_url=author.avatar_url)
embed.set_footer(text=f"Deleted in : #{channel_name}")
await ctx.channel.send(embed=embed)
thanks
oo I see, thanks!
What do you think is wrong
https://stackoverflow.com/questions/67453633/how-to-snipe-messages-from-a-specific-channel-discord-py copied code lol
lmao
oh thanks, I actually found that from a video
the code tutorial
nothing shows up when i delete msg and do command
You need await client.process_commands(message) in your on_message event
Although you could just replace .event with .listen('on_message') which is what's more recommended
ok, I will try, thank you
def embed(self, ctx: Context, **kwargs) -> discord.Embed:
"""This is how we deliver features like custom footer and custom color :)"""
embed = discord.Embed(**kwargs)
embed.color = embed_color
return embed
``` this should override all the embeds right? or do i need to set in the cmd `color = self.bot.color` ???
Hi, I am trying to make a simple command that makes the bot post a custom animated emoji (I know the emoji format, discord doesnt let me show it so it will show up as :Fire:
@client.command()
async def wfire(ctx):
if ctx == 'wfire':
await ctx.send(":Fire:")
thanks
you would want a second parameter
async def wfire(ctx, emoji):
and you would check for the emoji's content
if emoji == 'wfire':
you mean :fire:
it didnt work and what do you mean by this
ok
@client.command()
async def wfire(ctx, emoji):
if ctx == 'wfire':
await ctx.send(":Fire:")
^
again, discord doesnt let me said the emoji format
if statement?
i did that before
Apparently not
I tried it before
@client.command()
async def wfire(ctx, emoji):
if emoji == 'wfire':
await ctx.send(":Fire:")
oh thanks
is there any way to remove the 2nd wfire?
Just remove the if statement and parameter
And send the emote directly
well then you wouldn't need the if statement
@client.command()
async def wfire(ctx):
await ctx.send(":Fire:")```
simplest ever command
Why would you need a command that sends an emote you can send by yourself though 
oh yeah, it was an event then i changed it to command, i forgot to remove the if
nitro :(
that one i am doing is animated
that one is:fire: not :Fire:
That's not how to send custom emotes though
Should send something like that !sh_xelmofire
yes i know
but discord doesnt let me send it like that
cause i dont have nitro
when i try that it just goes to :Fire:
yes i know
yes i know


i know
Can i reboot my bot with a command?
U can log out, sure... But u gotta use a third party script to see if its running or not
I am trying to set up channel permissions, but I can't get it to work.
What's wrong with this code?
c o g s
.....?
reload cogs
What if they changed the imports?
Btw, i'm new in discord.py so i haven't a cogs folder
then... that sucks
(:
):
Why r u getting the channel again if u have the channel in channel var?
Where can I correct this?
Wym
What do you think should be fixed in this code?
You already have channel, so declaring support_channel is redundant and therefore not needed
is there a sol. to this issue?
plz tell me if there is!
What operating system and version are you using
win10, latest version
py 3.9.0
Download and install this certificate here:
https://crt.sh/?id=2835394
It can be installed by double clicking the file and installing it to Local Computer.
uhh, thanks for this
Just out of curosity, why was my code working when I used requests lib, and used Curl directly?
uhh I see
Ah
No worries
I am also getting that error literally everywhere, even with my API
In the ClientSession class, set the connector kwarg to something like this connector=TCPConnector(ssl=False)
This will connect without SSL
I have tried that also. Didn't work for me at least lol
Well that's unfortunate 
But is it a coincidence that all of a sudden it stops working for me on my local PC but it works perfectly on my VPS? I don't think so
Also, when I to to the API URL manually, it shows the SSL Lock symbol, and also it's hosted on repl and the domain on cloudflare. So I don't think that's an API problem
You realize that the root certificate of Let's Encrypt expired a few weeks ago
So if you don't have an OS update or similar you can't go on multiple websites because of that
Which means old devices are pretty much not able to access these websites
Is that what repl uses?
Ah thanks
Is that where your API is hosted or what?
Repl: API
Cloudflare: Domain
Well pretty sure replit uses cloudflare
Possible
How do i make it so a user can only react once to a message
You mean use one reaction emote only per user
Use the reaction add event and check if the message already has a reaction from the user, if yes: delete it
oo I see
lmao
How do i check if it has a reaction from the user
and how do i remove the previous reaction
yea very true, it works completely fine on google colab, but not on local machine
Docs (have example) & loop
Docs
docs?
!d discord.Reaction.on_raw_reaction_add
No documentation found for the requested symbol.
Read the docs
oh
!d discord.on_raw_reaction_add
discord.on_raw_reaction_add(payload)```
Called when a message has a reaction added. Unlike [`on_reaction_add()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_reaction_add "discord.on_reaction_add"), this is called regardless of the state of the internal message cache.
This requires [`Intents.reactions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.reactions "discord.Intents.reactions") to be enabled.
yeah, me nub, this was the one
hmm
Well as I said, it's not an API issue
tru
It's because the root certificate expired, this certificate is stored on each device
And if you can't update your device with security updates or similar, then the certificate won't get updated
yeah
Yeah I get it
so im tryna do something that lets me use the id on a website so every time i get the user id, it doesn't nothing to the id just affects a database but the error says guild isnt irritable
the line thats wrong is
for member in ctx.guild:
i did enable all intents
did you try testing with print statements
lemme try lmao
so how can i go through members?
!d discord.Guild
class discord.Guild```
Represents a Discord guild.
This is referred to as a “server” in the official Discord UI.
x == y Checks if two guilds are equal.
x != y Checks if two guilds are not equal.
hash(x) Returns the guild’s hash.
str(x) Returns the guild’s name.
guild.members
!d discord.Guild.members
property members: List[discord.member.Member]```
A list of members that belong to this guild.
for member in guild.members:
oke
does await client.wait_for stops the further code from execution?
for
farmm = client.get_channel(id)
how to specify guild where it should search for channel?
who know how to make card bot?
wait = await client.wait_for('message',check=Check,timeout=15)
print(wait.content)```
is it going to print after the user sent the message ?
yeah
alright
Hey guys, I'm facing an issue with my bot (discord.py), can someone help me?
Don't ask to ask, just send your question
Of course someone can help you, just not if you don't say for what you need help for
It replies this
message.content
In your embed
As I said
This is the code I'm using
def Check(message: discord.Message):
return message.channel == 845971398680641572 and message.content == "hello"```
whats wrong ;-;
it always gives timeout error so the Check is not true
Wow, can't believe it was so simple!
Thanks million times guys!

Oh and, you can also change your if statement @slate swan
Remove the str()
And remove the quotes from your id
So just
if message.channel.id == id
why is this not being sent
Do you have an on_message event?
yea
Edited, thanks.
Do you have pocess_commands(message)
And is your client variable actually Bot
this one ?
See, it's a bot
ok
Ok, another question.
What command can I use to show live number of reactions to a particular message?
So don't name your variable client
But anyways
You will need this
following naming conventions, you should press ctrl + r and replace everything that says client -> bot.
so is my variable named client or bot
In your on_message event add await client.process_commands(message)
you should make it bot.
ok
And consider renaming your variable to bot
!d discord.Message.reactions
Reactions to a message. Reactions can be either custom emoji or standard unicode emoji.
Returns a list, so get the length of that
what this do
Process your commands 
Then you don't need it
No?
You could also just add that line of code..
coder moment
If it's just to print A message has been sent, then you can already remove it
You can remove it no matter what, is just code
why this error occurs and how to fix this
name 'farmm' is not defined
Code
import discord
from discord.ext import commands, tasks
from discord.utils import get
from discord.ext.tasks import loop
import asyncio
client = commands.Bot(command_prefix=">", case_insensitive=True, self_bot=True)
@client.event
async def on_ready():
print('Welcome master, the bot is online.')
for guild in client.guilds:
if guild.id == '837280815699591188':
farmm = guild.get_channel(897360659157749800)
break
@tasks.loop(seconds = 32)
async def farm():
await farmm.send('.work')
await asyncio.sleep(3)
await farmm.send('.dep all')
farm.start()
client.run(token)
Bot is in that guild
!rule 2
2. Follow the Discord Community Guidelines and Terms Of Service.
i wanna know how to get contents of a message sent by user and use it in the response.
it is not self bot but test if bot will say bot command will it work
i copied some code for that
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
youtube iam learning from there
hello i just create simple bot with Python, i want to ask about, How My bot can Play/Listinening to something?
Is there any way I can update this, as well as change Embed color?
I have not worked with Embed messages before.
Though I have written code for editing simple messages, but kinda skeptical with embeds.
This is my code for editing simple messages
# Setting `Playing ` status
await bot.change_presence(activity=discord.Game(name="a game"))
# Setting `Streaming ` status
await bot.change_presence(activity=discord.Streaming(name="My Stream", url=my_twitch_url))
# Setting `Listening ` status
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name="a song"))
# Setting `Watching ` status
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name="a movie"))
u wanna build a music bot?
No just for command
ok so u meant the status
Yes that it how i can do that?
this
copy the line of code u want as status
not all
Can someone take a look here, please?
to change the color of embed
embed=discord.Embed(title='Your title', description="Your description", color=0x552E12)
!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.
!d discord.Message.embeds
A list of embeds the message has.
dose anybody know what i did wrong
Send is a method

message.content?
yea but i want to cut/slice it and use it in response too
Well its a string, you can slice it however you want
i got this NameError: name 'client' is not defined, how i can fix that?
sorry i'm so lazy, i just learning python 1 day ago
a) Probably learn more python
b) Maybe you defined you instance as bot
@zinc mural cog name not found
Can we see your code for the cog?
import discord
import os
from discord import client
from discord.ext import commands
from discord.ext.commands import bot
from discord.flags import Intents
intents = discord.Intents.default()
intents.members = True
client = commands.Bot(command_prefix=";")
@client.event
async def on_ready():
print("The bot is ready!")
initial_extensions = []
for filename in os.listdir('./cogs'):
if filename.endswith('.py'):
initial_extensions.append("cogs." + filename[:-3])
if __name__ == '__main__':
for extension in initial_extensions:
client.load_extension(extension)
Can we see your code for the cog?
import discord
import asyncio
from discord.client import Client
import requests
from discord.ext import commands
import os
class test(commands.Cog):
def __init__(self, client):
self.bot = client
def setup(client):
client.add_cog(test(client))
@valid perch
Thanks friend its work 👍
Nah, the relative filepath @zinc mural
Uh huh, and where does that file live?
In a folder called cogs?
@zinc mural
This should be fun
@zinc mural it needs to be in a cogs folder
How do I make it that a message is always split at the 10th place as an example?
from discord.ext import commands
import time
client = commands.Bot(command_prefix='?')
@client.command(aliases=['gav', 'Am i good at valorant?', 'GAV?'])
async def GAV(ctx):
await ctx.send('Which Rank Are You')
client.run('noway.im.giving.my.bots.token.for.free.lmao')```
How do i make it so that, the answer of ?GAV is Iron, Bronze, Silver, Gold, Platinum, Diamond, Immortal, Radiant or it says your wrong or something.
@zinc mural Show us the file structure of your project.
@zinc mural or show file path
I tried this, but still not working. What's the error?
wrong indents
also is there a way i can make my .json file which i got form discohook and make that display as an embed?
Where?
seems like the command is inside a command
what indent level is it at?
My message is getting deleted
Without being able to copy it, the indents look good to me. There's an excess indent towards the bottom but it looks good.
@slate swan Please send it without the bitly invite link
Oh ok, thanks for help
async def on_message(message):
if message.channel.id == 815284413586866246:
await message.add_reaction(':white_check_mark:')
await message.add_reaction(':x:')
pfp = message.author.avatar_url
embedd=discord.Embed(title="JEE Server", url="", color=discord.Color.blue())
embedd.set_author(name= message.author.display_name, icon_url=pfp)
embedd.set_thumbnail(url=pfp)
embedd.add_field(name="Suggestion", value=message.content, inline=False)
embedd.add_field(name="Suggestion Status", value="Pending", inline=False)
sendChannel = bot.get_channel(815284513868873768)
await sendChannel.send(embed = embedd)
@bot.command()#6600
async def suggestion(ctx, messageid:int=None):
if messageid == None:
await ctx.send("Something's amiss")
return
role = discord.utils.get(ctx.guild.roles, name=botManager)
sendChannel = 815284513868873768
msg = await sendChannel.fetch_message(messageid)
if role in ctx.message.author.roles or str(ctx.message.author.id) in msg.content:
text = ctx.message.content
embedd.edit_field(name="Suggestion Status", value =text, inline=False)
await msg.edit(content=text)
if role not in ctx.message.author.roles:
await ctx.send("Please do not misue this command.", delete_after=10)
else:
await ctx.send("Please do not misue this command.")```
Im tryna make a giveaway command and i wanted help on this
hey there, I am not able to extract data from a api, which has the element name as 'createdAt'
data here
how can i start a timer after a command is called?
what inf loop will not cause commands to not work?
while loop currently
What do ou wanna do
i have code that check if user have enough warns for punishment and i want to loop it without interrupting commands
what permission is needed to see who is banned?
make an async timer prob
async loop function prob
tasks.loop
^^
discord.Permissions.read_message_history
i did it like this and it still don't dm people when they join
did you enable member intent
yea
thats not the correct way
you can just do await member.send(f"Hi {member.name}, how are you !")
so i dont have to do create_dm
stop copying old tutorials
just send the message to the member object
Does anyone know how to fix this Errno 22 invalid arg error
I was getting a timestamp from a api, and was converting it thru
import time
converted_time = time.ctime(data['createdAt'])
msg_id, channel_id, category_id = 'txt/ticket_config.txt'[payload.guild_id]
IndexError: string index out of range
Can someone explain?
how to check if person that executed of message reacted with specific message
i mean if i have code like that
@client.command()
async def test(ctx):
teest = client.get_channel(id)
varabel = await teest.send('test message')
await varabel.add_reaction('❌')
and i want to check if person who executed the command reacted to that message with that emoji how do i do that?
please show the code
I need to fix that piece of code, the rest of the code works fine at all moments.
umm, without the code, I can't really help it out
I just need to know how I have to define It If It doesnt recognize the strings
u need to use the event on_raw_reaction_add event
!d discord.on_raw_reaction_add
discord.on_raw_reaction_add(payload)```
Called when a message has a reaction added. Unlike [`on_reaction_add()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_reaction_add "discord.on_reaction_add"), this is called regardless of the state of the internal message cache.
This requires [`Intents.reactions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.reactions "discord.Intents.reactions") to be enabled.
is payload.guild_id a thing
theres no class called Payload
!d discord.RawReactionActionEvent
class discord.RawReactionActionEvent```
Represents the payload for a [`on_raw_reaction_add()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_raw_reaction_add "discord.on_raw_reaction_add") or [`on_raw_reaction_remove()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_raw_reaction_remove "discord.on_raw_reaction_remove") event.
Its a variable name in a function. That ^ is the class it gets given.
From this event
anyone?
is this a bug?
Doesnt look related to dpy, maybe #❓|how-to-get-help and then @ me in the channel
How would it be a bug?
Are you
a) referring to the time differences
b) The multiple sends
ok!
On the assumption your code should send once, it means you have multiple instances of your bot running
oh, and how to fix it?
k got it
Stop running your bot before you run it again
msg = await messageable.send(...) ... msg.id
where messageable is an instance of discord.abc.Messageable
!d discord.Message msg returns an instance of discord.Message
class discord.Message```
Represents a message from Discord.
x == y Checks if two messages are equal.
x != y Checks if two messages are not equal.
hash(x) Returns the message’s hash.
anyway how do you do that on Atom
you can get channel thru , botobj.get_channel(id) and use .send
i get error py @client.event async def on_member_join(member): print("Recognised that a member called " + member.name + " joined") try: await client.send_message(member, newUserMessage) print("Sent message to " + member.name) except: print("Couldn't message " + member.name) embed=discord.Embed title="Welcome "+member.name+"!" description="Welcome to 404." color=discord.Color.green()
!d discord.Client.get_channel
get_channel(id, /)```
Returns a channel or thread with the given ID.
@client.event
async def on_member_join(member):
print("Recognised that a member called " + member.name + " joined")
try:
await client.send_message(member, newUserMessage)
print("Sent message to " + member.name)
except:
print("Couldn't message " + member.name)
embed=discord.Embed
title="Welcome "+member.name+"!"
description="Welcome to 404."
color=discord.Color.green()
you need an instance of discord.abc.Messageable to send a message. (discord.abc.messageable is just a channel that the bot can send messages in). To get this you can use bot.get_channel, then you just send a message to the channel
the code is outdated , send_message is no longer a thing , you would have to py await member.send( 'your message')
import asyncio
bot = commands.Bot(command_prefix='$')
@bot.command()
async def test(ctx):
await ctx.send('Hello!')
async def timer(ctx, timeInput):
try:
try:
time = int(timeInput)
except:
convertTimeList = {'s':1, 'm':60, 'h':3600, 'd':86400, 'S':1, 'M':60, 'H':3600, 'D':86400}
time = int(timeInput[:-1]) * convertTimeList[timeInput[-1]]
if time > 86400:
await ctx.send("I can\'t do timers over a day long")
return
if time <= 0:
await ctx.send("Timers don\'t go into negatives :/")
return
if time >= 3600:
message = await ctx.send(f"Timer: {time//3600} hours {time%3600//60} minutes {time%60} seconds")
elif time >= 60:
message = await ctx.send(f"Timer: {time//60} minutes {time%60} seconds")
elif time < 60:
message = await ctx.send(f"Timer: {time} seconds")
while True:
try:
await asyncio.sleep(5)
time -= 5
if time >= 3600:
await message.edit(content=f"Timer: {time//3600} hours {time %3600//60} minutes {time%60} seconds")
elif time >= 60:
await message.edit(content=f"Timer: {time//60} minutes {time%60} seconds")
elif time < 60:
await message.edit(content=f"Timer: {time} seconds")
if time <= 0:
await message.edit(content="Ended!")
await ctx.send(f"{ctx.author.mention} Your countdown Has ended!")
break
except:
break
except:
await ctx.send(f"Alright, first you gotta let me know how I\'m gonna time **{timeInput}**....")
bot.run('token')```
use 3 ```
ooh
!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.
why did you put @commands.command
uhm uhh
nice copy & paste.
cause someone sent it
it gives me an error when running timer command
commands.command is meant to be used in cogs
you should use @bot.command() as per your code
i am new to bot development
class discord.Embed(*, colour=Embed.Empty, color=Embed.Empty, title=Embed.Empty, type='rich', url=Embed.Empty, description=Embed.Empty, timestamp=None)```
Represents a Discord embed.
len(x) Returns the total size of the embed. Useful for checking if it’s within the 6000 character limit.
bool(b) Returns whether the embed has any data set.
New in version 2.0.
Certain properties return an `EmbedProxy`, a type that acts similar to a regular [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.9)") except using dotted access, e.g. `embed.author.icon_url`. If the attribute is invalid or empty, then a special sentinel value is returned, [`Embed.Empty`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed.Empty "discord.Embed.Empty").
For ease of use, all parameters that expect a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") are implicitly casted to [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") for you.
dont copy paste code , look into the docs
if you dont understand anything people here would for sure always help
what that error means?
Ignoring exception in command sta:
Traceback (most recent call last):
File "C:\Users\barte\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "C:\Users\barte\source\repos\bottt\bottt\bottt.py", line 44, in sta
await varabel.add_reaction('❌')
File "C:\Users\barte\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\message.py", line 1149, in add_reaction
await self._state.http.add_reaction(self.channel.id, self.id, emoji)
File "C:\Users\barte\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\http.py", line 241, in request
raise Forbidden(r, data)
discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\barte\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 902, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\barte\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 864, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\barte\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: Forbidden: 403 Forbidden (error code: 50013): Missing Permissions
it stops at this part
await varabel.add_reaction('❌')
"varabel" definde line above
varabel = await arg.send('started loop')
i edited it it still says
Command "timer" is not found
just read the last line
error is already clear
Timer isnt a command, its just a function
@rain ridge
they had py @commands.command() async def timer..... But edited it
Fun
i know that is missing permissions for some reason
i made sure it can add reactions so this is what i don't understand
ok it worked
check the channel specific perms
so whenever i have to declare a function as a command i have to put
@bot.command()
in your main file , sure
Dont forget the ()
yea
Hey I am trying to make a tempban command on dpy with storing values in mongo
@tasks.loop(seconds=600)
async def checker(self):
try:
all = self.coll.find({}) # return all documents inside the db
current_time = datetime.datetime.now()
async for x in all:
if current >= x["BannedUntil"]: # do stuff after this
unbanuser = z["user_id"]
await z.unban(reason="Tempban for new account expired.")
else:
pass
except Exception:
pass
Here is my checker to loop every 10mins not sure if I am unbanning the user in the right way?
tempbanned = {"user_id": user.id, "BannedUntil": final_time}
Storing it like this
what's z?
unbanuser = z["user_id"]
Getting the user id for the user from the database?
I am new to dbs thats the reason I am not sure if I am doing it the right way
you never defined the variable z
any error you get?
Oh wait so would unbanuser.unban be the right way?
no , unbanuser would return an int , which has no unban attribute
you need to fetch the user first
I am yet to implement this code because of a few hiccups.. will try that and get back to you ig
Isnt that what I am doing in
unbanuser = z["user_id"]
?
no , sir , you are getting the user id
()
thats what wrapping is..
OH right! I am starting to get this now 😭 Sorry for being dumb
?
member = discord.Object(id={unbanuser})
await member.unban(reason="Tempban for new account expired.")
``` Does that make more sense?
ou sorry wrong member
yeah sure , but you must use py <THE guild>.unban(member)
since member would be a user , and it has no unban attribute
you can get the guild object by
!d discord.Client.get_guild
get_guild(id, /)```
Returns a guild with the given ID.
https://discordpy.readthedocs.io/en/latest/api.html#discord.Member.unban I used member.unban since I saw this
is it something else?
sorry
Unbans this member. Equivalent to Guild.unban().
Thats what it said
ok
Any clue why guild returned as a nonetype object ? got error while reeboting the bot
yeah , but Member and User are diffrent objects
{guild.owner.mention} try this
the owner may be also be nonetype
turn on member intents
jes
I have it
Wait I dont understand- I am not using user? I am using member
in the code as well?
and me
the variable name does not change the object type
discord.Object(id = an id) will return the User object
OH
Ofc
how is the variable guild defined?
Its the arg of the on_guild_remove event
can you try printing py guild.name #and guild.owner.name once
you would get the exact point where the error occurs
would be easier to help
Makes no sense cause it works for all guilds the bot joined,
/left
member = discord.Object(id={unbanuser})
guild = get_guild(int)
await guild.unban(reason="Tempban for new account expired.")
Is this what you meant?
Might be the owner deleted the guild whilst the bot was in it
maybe , letme check that condition
sure , but it should be <bot/client object>get_guild
and it takes the member as an argument
by it i mean unban
Gotcha thanks so much
nope , it should still work decently
( im using guild.name and guild.owner.name attributes)
Ahh im confused too why guild object returned nonetype
lol
how can you be sure it was guild.name and not guild.owner.name?
hmm could be
!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.
also use aiohttp instead of requests
whats wrong with it?
bot = commands.Bot(command_prefix='-',help_command=None)```
```py
@bot.command()
async def start(ctx):
link = await bot.togetherControl.create_link(ctx.author.voice.channel.id, 'youtube')
await ctx.channel.send(f"Click the blue link!\n{link}")```
the error says it all
but how. i copied it exact the same thing as the doc
https://pypi.org/project/discord-together/
hi may i ask how to make the bot react to it own message?
await client.add_reaction('1️⃣')
But like this it say the bot has no attritube to react
Can someone help me?
Store the message or fetch the message so you can react to it
oh okay. im try it .thanks bro .
you for sure miss something
maybe changing the internals
@slate swan He is for sure missing something but i don't really condone copying code.
yep
if they could read the docs , instead of just copying the part they need
it would be more helpful
The discord-together is meant to be used in OOP so he hasn't defined togetherControl in self.
It's a weird pypi anyways since it's basically one function.
or can define a variable for that
in case they dont subclass it
read the error
you havent defined role in else
help me pls
import discord
import os
from discord import client
from discord.ext import commands
from discord.ext.commands import bot
from discord.flags import Intents
intents = discord.Intents.default()
intents.members = True
client = commands.Bot(command_prefix=";")
@client.event
async def on_ready():
print("The bot is ready!")
initial_extensions = []
for filename in os.listdir('./cogs'):
if filename.endswith('.py'):
initial_extensions.append("cogs." + filename[:-3])
if __name__ == '__main__':
for extension in initial_extensions:
client.load_extension(extension)
client.run
I recommend not copying code especially bad code.
You got a cogs folder?
yea
could you share a screenshot of your file structure?
do me a favor and do print(os.getcwd()) all questions will be answered.
Most likely he is executing this code inside his debugger.
oh also you made those nice intents, but they aren't used, you probably want to pass them to the Bot constructor
Also please use correct naming convention. doing client = commands.Bot is bad naming convention. You should name it bot and not client
done
And?
before the error ofc
I think he is going to need a token first.. 
it happens in python3.9 if the cog folder is in same directory
for that i was assuming they just cut it out to hide it, but the user could have very well forgotten to add the code yes
Never had this issue although i use another method of cog loading
How to make welcome bot?
this cog loading code has worked for me since 3.8 and has been tested in 3.10. It has gone over a few iterations of visual improvement but the core functionality remained the same
https://github.com/sebkuip/Tekxitbot/blob/0d43e96546f22e2542c9357610006de58771c79c/pybot.py#L52-L72
How does code not fit in a cog 😂
I use this for loading -> https://github.com/Pandabweer/dispy-discord-bot/blob/main/utils/extensions.py#L13-L30
things like load and unload won't work if the cog is unloaded, so i made those accessible at all times in the main file
also that on_message is a sort of tag system that works before a command is executed so ye
ahhh that way of fit
@cloud dawn doesn't work
eh?
it keep showing this
cwd?
!d os.getcwd
os.getcwd()```
Return a string representing the current working directory.
import discord
import os
from discord import client
from discord.ext import commands
from discord.ext.commands import bot
from discord.flags import Intents
intents = discord.Intents.default()
intents.members = True
bot = commands.Bot(command_prefix=";")
@bot.event
async def on_ready():
print("The bot is ready!")
initial_extensions = []
for filename in os.listdir('./cogs'):
if filename.endswith('.py'):
initial_extensions.append("cogs." + filename[:-3])
if __name__ == '__main__':
for extension in initial_extensions:
client.load_extension(extension)
print(os.getcwd())
client.run
like this?
import discord
import os
from discord import client
from discord.ext import commands
from discord.ext.commands import bot
from discord.flags import Intents
intents = discord.Intents.default()
intents.members = True
print(os.getcwd())
bot = commands.Bot(command_prefix=";")
@bot.event
async def on_ready():
print("The bot is ready!")
initial_extensions = []
for filename in os.listdir('./cogs'):
if filename.endswith('.py'):
initial_extensions.append("cogs." + filename[:-3])
if __name__ == '__main__':
for extension in initial_extensions:
client.load_extension(extension)
client.run
``` Before the error
import discord
import os
from discord import client
from discord.ext import commands
from discord.ext.commands import bot
from discord.flags import Intents
intents = discord.Intents.default()
intents.members = True
bot = commands.Bot(command_prefix=";")
@bot.event
async def on_ready():
print("The bot is ready!")
initial_extensions = []
print(os.getcwd())
for filename in os.listdir('./cogs'):
if filename.endswith('.py'):
initial_extensions.append("cogs." + filename[:-3])
if __name__ == '__main__':
for extension in initial_extensions:
client.load_extension(extension)
client.run
so how
This is also fine
what's the next step
What is the cwd
the terminal?
The cwd
what does your code print
Okay lets do this
import discord
import os
from discord import client
from discord.ext import commands
from discord.ext.commands import bot
from discord.flags import Intents
while True:
print(os.getcwd())
intents = discord.Intents.default()
intents.members = True
print(os.getcwd())
bot = commands.Bot(command_prefix=";")
@bot.event
async def on_ready():
print("The bot is ready!")
initial_extensions = []
for filename in os.listdir('./cogs'):
if filename.endswith('.py'):
initial_extensions.append("cogs." + filename[:-3])
if __name__ == '__main__':
for extension in initial_extensions:
client.load_extension(extension)
client.run
What does it spam?
Does that dir have a cogs folder?
you can manually declare a list of cogs and use them to load the extensions
Who manually declares a list of cogs 😂
lmao carl bot's owner did
the open source version
def tempban(self,ctx, user: discord.Member,seconds):
text = (seconds)
in_seconds = {'h': 60 * 60, 'm': 60, 's': 1, ' ': 1}
seconds = sum(int(num) * in_seconds[weight if weight else 's'] for num, weight in
re.findall(r'(\d+)\s?(m|s|h)?', text))
current_time = datetime.datetime.now()
final_time = current_time + datetime.timedelta(seconds=seconds)
tempbanned = {"user_id": user.id, "BannedUntil": final_time}
self.coll.insert_one(tempbanned)
This is how I defined my tempban
on_member_join
await self.tempban(user.id,bannedday)
TypeError: tempban() missing 1 required positional argument: 'seconds'
However I get this error when I user joins
now = datetime.utcnow()
age = now - user.created_at
days = age.days
banday = (14 - days)
bannedday = (banday*24*60*60)
Thats how bannedday is defined
!d discord.User.mention
property mention: str```
Returns a string that allows you to mention the given user.
or discord.Member.mention
This code hurts my soul
you didnt provide self
it seems too basic
hello how to solve?
self where?
pip install discord.py
yes but its wrong version
@cloud dawn what to do now
?
Well what do you think is the issue with that cwd?
@silk epoch
hey guys, so im making a verificaton bot and it creates the reaction but for some reason its not giving me any roles this is my code
async def on_raw_reaction_add(payload):
if payload.member.bot:
pass
else:
with open('reactrole.json') as react_file:
data = json.load(react_file)
for x in data:
if x['emoji'] == payload.emoji.name and x['message_id'] == payload.message_id:
role = discord.utils.get(bot.get_guild(payload.guild_id).roles, id=x['role_id'])
await bot.get_guild(payload.guild_id).get_member(paylod.user_id).remove_roles(role)
@bot.event
async def on_raw_reaction_remove(payload):
if payload.member.bot:
pass
else:
with open('reactrole.json') as react_file:
data = json.load(react_file)
for x in data:
if x['emoji'] == payload.emoji.name and x['message_id'] == payload.message_id:
role = discord.utils.get(bot.get_guild(payload.guild_id).roles, id=x['role_id'])
await payload.member.add_roles(role)```
@commands.has_role('👑CEO👑')
async def reactrole (ctx, emoji, role : discord.Role, *, message):
embed = discord.Embed(description = message)
msg = await ctx.channel.send(embed = embed)
await msg.add_reaction(emoji)
with open('reactrole.json') as json_file:
data = json.load(json_file)
new_react_role = {
'role_name' : role.name,
'role_id' : role.id,
'emoji' : emoji,
'message_id' : msg.id
}
data.append(new_react_role)
with open('reactrole.json', 'w') as j:
json.dump(data, j, indent = 4)```
im not getting any error code either
async def hug(self, ctx):
await self.bot.say("hugs {}".format(ctx.message.author.mention()))
An example @formal portal. member.mention() should be pinging someone once sent.
lyrics_embed = discord.Embed(title=f"{song.title} - Lyrics",
description=song.lyrics, color=discord.Colour.random())
lyrics_embed.set_thumbnail(url=song.song_art_image_thumbnail_url)
lyrics_embed.set_footer(
icon_url=self.bot.user.avatar_url, text="Lyrics from Genius API.")
await ctx.send(embed=lyrics_embed)```
i want to split the song.lyrics to overcome the character limit. help pls
whats ctx
context
Have you read the discord.py Documentation?
use a paginator
Or any tutorials? @formal portal
where
if anyone is pretty good at reaction roles can u dm me because i need help with my verification bot
any other way?
https://discordpy.readthedocs.io/en/stable/
your token is not valid
A guide on how to
I could brute force this token
my token is valid.
That part is true
That is really not hard to brute force. You are right with that.
Just generate a new token.
omg
py -m pip install discord.py
Uh Mass dm? Tos alert- I am not helping 
python splitlines ig? not sure tho
aha oh shi
discord.py not discord
huh? no
where can i have a look to paginate?
if anyone is pretty good at reaction roles can u dm me because i need help with my verification bot
im not getting an error code
I just regenerate :/
!pypi discord.py
just wont give me role
the token you passed is not valid
is ur json set up correctly
if you click regenerate that means it made a new token and the old token is invalid
does no one here know how to do reaction roles?
!pypi paginator
use an on_raw_reaction_add event
then just look in a database for what emoji role and message etc
ive done that im getting no error i just am not getting the role
Wait no thats not right
I do
look at my code
.
thats my code there
i get no error but i also get no role
iirc you do pip install discord might be wrong
Yes you are.
pip install discord is completely wrong, hence why i said discord.py and not discord
@waxen granite Do rtfm paginator in dpy server
Okay!
and what do i have to do next

its just a python thing not



