#discord-bots
1 messages Β· Page 1134 of 1
it was a idiom
just copy it and try it
ok
oops sorry for ping ashley
an*
uh grmr mistakes
i just wanted to learn wait for to add games in my bot
not working
bruh, the check πΏ
oh hi sarth we meet again
yesterday we met
sorry, god
!e ```py
if any( word in "ash is always high" for word in ("hi", "hello")): print("yes")
@slate swan :white_check_mark: Your eval job has completed with return code 0.
yes
oh my bad, but still any isnt a statement god
a perfect reason to use str.split() ^
that was kinda rude tbh
π just stop
call it whatever you want to, but it works.
calling me high
high, like a god
whatever said I'm still a sick maniac lmao
bye guys
π
(s:=set(sentence.split()))-filtered_word_set != s
(set(sentence.split()).intersection( {set of filtered words})```
i missed a bracket so don't mind me
if set(sentence.split()) & filtered_word_set:
print("yes")
oh yes, forgot about intersection
re.search(f"[{'|'.join(filtered_words)}]", sentence)
Regex is way slower
How would I get a list of timeout members in a guild?
π
do a list comprehension, loop on all guild members and check their timeouts if any
a generator comprehension is better if there's 380,000 elements?
im not sure but it should be same, unless you're using map
380,000 is nothing gets done in a jiffy even with lists
ya :/
*7k
Hi, so I'm having this error when coding a discord bot in python "could not import 'interactions' from 'nextcord' " does anyone know how to fix this?
Hey I programmed a Slash Commands for my Bot and it seems that I didnβt work. Now like I said should I delete it and put some Events & Intents on it?
i think you are looking for Interaction not interactions
Alright. I'll try this but if this doesn't work I'll let you know
sure\
wdym Slash commands didnt work? they didnt show up in the guild?
It's still not working
Yeah I used npm run deploycommands and it says readdirSync isnβt defined
@paper sluice
And now itβs offline
what did you import show code
js?
Yes
this is a python server
It said interaction not interactions but it still has the same error
But in python itβs the same
And then I made it in python
But yeah I will look
@paper sluice I still had the same error
I'll never get this damn bot online):
!d nextcord.Interaction
class nextcord.Interaction```
Represents a Discord interaction.
An interaction happens when a user does an action that needs to be notified. Current examples are slash commands and components.
New in version 2.0.
New in version 2.0.
do you have 2.0 installed?
Lemme check
Yes
I have 2.0
u did from nextcord import Interaction right?
Yes
I have a question can we put two buttons containing a link in an embed?
which IDE do you use?
Atom
what do you type to run your bot, like python filname.py?
Yes
Python3 openDB.py
That's the command I used
try to install nextcord using python3 -m pip ...
and then run ur script
make sure you install nextcord 2.0
How do I turn text into a code font like you just did?
You could probably optimise the regular expression but that would probably still be slower than using set notation
yes, I'm pretty sure you can.
`text`
Ok thanks bro
ya
Didn't work
or three of these ` for a code block
no i mean install nextcord using python3 -m pip install ...
lol
That's how I installed nextcord. Did you expect me to use sudo apt install nextcord? That's a noob move.
In my opinion
no, sometimes having multiple versions installed messes with ur env.
I did install nextcord correctly tho
hmm, then i have no clue, sry
Man I'm starting to hate Linux. There's no way in hell I'm going back to windows tho.
windows is always bad lol
what IDE are you using rn?
Atom
Updates every damn second and telemetry. And you still get ads when you pay for the software.
π eh, just use vsc or something they allow you to choose what interpreter you want to run with
can you do python -m pip freeze
Can't use vsc. I'm on linux
huh?
Fork of unix, better alternative to windows. A penguin as a mascot
bruh ik what linux is.
im using vsc rn in linux.
just install the deb or whatever distro ur using from their site
Is that fedora?
its kali/debian
are you on fedora?
I don't trust those sick data collecting fucks
I'm on Linux mint (fork of Ubuntu)
atom is owned by github and github is owned by microsoft btw
I denied the telemetry in atom
They did ask for telemetry permission which obviously I refused
atom is not even continued , and the telementry can be declined for any ide
I did actually try to install vsc on my laptop when it had a virus (windows 10) and I find it very difficult
download this, go to ur terminal ```bash
$sudo dpkg -i thisfile
I'm already happy with atom tho.
upto you, just telling that its
- possible to use vsc in linux
- atom is not providing any security that it does not
^ and run this command in ur terminal
Alright
@slate swan I tried the command. It didn't help the error
its not a command to fix your error, it lists all the installed libraries
do you see nextcord in it?
Lemme look
@slate swan yes it's there
and how do you run the bot?
i mean the terminal command
Cd openDB
Python3 openDB.py
(These are the commands I use to run it)
openDB is a folder and openDB.py is a file inside it?
Yes
cool, now try using python openDB
Alright
Do I use python3 or just python?
python
Alright
It keeps on saying command not found
I think I have to use python3
what did you use last time when i asked to use the freeze command then?
python3?
No, I just typed pip freeze
That's literally all I typed because for some reason when I put in -m it just says command not found
Same when I try to use python3
How do I kicked user's ID?
did you install pip using apt?
π€¨
No
I forgot the exact command I used to install pip but it was definitely not apt
install pip binded with python, else that would be problematic.
That's what I did
if you did that, python3 -m pip would work.
what's the issuwue π
Damnit. Did I get a bootleg version of pip or something?
Lemme try this and see if I got a bootleg
you should search for get-pip.py for python 3.yourpythonversion
you'll find download link for the get-pip.py there
download it, and run it with your python3 command
Do I have to delete pip? I don't know the command to delete a package
nah just ignore that
Alright
What's that?
they have pip added to PATH somehow pip install works, but python3 -m pip wont
!venv a really useful tool
Virtual Environments
Virtual environments are isolated Python environments, which make it easier to keep your system clean and manage dependencies. By default, when activated, only libraries and scripts installed in the virtual environment are accessible, preventing cross-project dependency conflicts, and allowing easy isolation of requirements.
To create a new virtual environment, you can use the standard library venv module: python3 -m venv .venv (replace python3 with python or py on Windows)
Then, to activate the new virtual environment:
Windows (PowerShell): .venv\Scripts\Activate.ps1
or (Command Prompt): .venv\Scripts\activate.bat
MacOS / Linux (Bash): source .venv/bin/activate
Packages can then be installed to the virtual environment using pip, as normal.
For more information, take a read of the documentation. If you run code through your editor, check its documentation on how to make it use your virtual environment. For example, see the VSCode or PyCharm docs.
Tools such as poetry and pipenv can manage the creation of virtual environments as well as project dependencies, making packaging and installing your project easier.
Note: When using Windows PowerShell, you may need to change the execution policy first. This is only required once:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
try python -m pip instead π
they dont have python
py ?
python3
why do i have 3 python installations aaaaa
python adds that to literally every message
!e print("my opinions")
see?
I'm just trolling π
nice joke, very funny indeed
Thank you.
Can someone help please
i wouldn't be surprised if you were not, these things are too common in this channel.
send(embed=embed) , not send(embed)
you wont face this if you used hikari lightbulb
I'll never get my damn bot online π
try using a venv is the best thing i can suggest
Its an import error. I don't think this would require a venv
what does it say?
"could not import 'interaction' from 'nextcord' "
cause it doesnt exist
its Interaction
!d nextcord.Interaction
class nextcord.Interaction```
Represents a Discord interaction.
An interaction happens when a user does an action that needs to be notified. Current examples are slash commands and components.
New in version 2.0.
Yep, but it didn't sent anything
In that logging channel
save and rerun the code
I did-
do you have an error handler?
No, plus I am hosting it by pushing to heroku automatically.
So it doesn't display in terminal
If I do pass the code for openDB to one of you, you can finish the bot on one condition. KEEP IT OPEN SOURCE
you can run the bot and test it first before pushing it....
more like you should
unpush aint a thing, you can obv reset your commits and push the new state
Does anyone want to help the bot's development?
no
Import error: could not import 'interaction' from 'nextcord'
Bro Interaction not interaction
^
Oh my fucking god
@slate swan
I don't see it saying any errors for channel.send?
Yea DMs are closed and your code isn't running past that step
try:
# sending messages
except discord.HTTPException:
...
Huh?
So do I have to make intents have a uppercase I too?
What's that
where should I place it
You're making a discord bot in python and you don't even know try except statement π
yes, most python classes start with capital letters
its called PascalCase
I hope I can solve this with this info.
!d discord.Intents you can always refer to docs
class discord.Intents(value=0, **kwargs)```
Wraps up a Discord gateway intent flag.
Similar to [`Permissions`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions "discord.Permissions"), the properties provided are two way. You can set and retrieve individual bits using the properties as if they were regular bools.
To construct an object you can pass keyword arguments denoting the flags to enable or disable.
This is used to disable certain gateway features that are unnecessary to run your bot. To make use of this, it is passed to the `intents` keyword argument of [`Client`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Client "discord.Client").
New in version 1.5.
Well godamnit.
uhh-
might help me, Please?
I'm still getting an error even though I corrected my lower case I in "Intents = true"
It says it's a name error
@tough lance
@client.command(description="Kicks a member")
@commands.has_permissions(kick_members=True)
async def kick(ctx: commands.Context, member: disnake.Member = None, *, reason=None):
guildId = ctx.message.guild.id
guild = client.get_guild(guildId)
embed = disnake.Embed(
color=disnake.Color.blue(), title="**Notification**",
description=f"You have been **kicked** from **``{guild.name}``** (ID:{guildId}) for {reason}")
embed.timestamp = datetime.datetime.utcnow()
embed1 = disnake.Embed(
color=disnake.Color.blue(), title="",
description=f"***{member} ({member.id}) was kicked*** | {reason}")
embed2 = disnake.Embed(
color=disnake.Color.blue(), title="Action Log",
description=f"{member} ({member.id}) has been kicked by by {ctx.author} for {reason}")
if member == None:
await ctx.send("You have to specify an user!")
print('no user')
return
if member == ctx.message.author or member == None:
await ctx.send("You cannot kick yourself!")
print('yourself')
return
if reason == None:
await ctx.send("You have to specify a reason!")
print('no reason')
return
await ctx.guild.kick(member, reason=reason)
await ctx.send(embed=embed1)
await member.send(embed=embed)
logs = disnake.utils.get(ctx.guild.channels, name="punishment-logs")
await logs.send(embed=embed2)```
Params are usually lowercase
That's my command
"await member.send(embed=embed)
logs = disnake.utils.get(ctx.guild.channels, name="punishment-logs")"
Doesn't seem to work? Since it's not sending anything
in that channel
Somebody?
In the line, await member.send(embed=embed), the code produces the error that DMs are closed
So the code stops at that point and doesn't move to next statement
Bruhhhh
It will if DMs aren't closed
Okay, also man,
):
Also you're kicking then sending the message
its True not true
So what should I change there?
Thank you
Hence the user and bot doesn't have a mutual server and can't dm
It is capitalized
ya all constant singleton keywords in python are capitalized ( None, False, True )
I don't think timeout was there in dpy1.7
Alright
If you kick first and then send, there isn't a mutual server between bot and user and the bot can't dm, so send message first then kick
Yeah but what if it doesn't kick
bc of error - it will send message anyways?
And for the case that DMs are closed, use try and except statement
Uh, should it look like this or?
The error is "name error: name 'intents' is not defined
Is this another capitalization issue or something?
it would be better if you can show your code
I don't have a capture card
Hm
Do you want the .py?
just copy paste the part which is causing the error
Alright
Traceback (most recent call last):
File "openDB.py", line 6, in <module>
Intnets.Members = True
NameError: name 'Intnets' is not defined
superuser@devastation:~/openDB$
i have ```py
@bot.command()
@commands.has_role(620417313455210507)
async def timeouts(ctx):
timeouts = [member for member in ctx.guild.members if member.current_timeout]
if not timeouts:
members = 'No members are currently on timeout'
else:
members = "\n".join([f'{member.mention} {str(member)}' for member in timeouts])
embed = disnake.Embed(title=f'Members on timeout ({len(timeouts)})', description=members)
await ctx.send(embed=embed)
but it takes a very long time to execute
@paper sluice
is it worth noting that it's iterating through 380,000 members
do this
import nextcord
intents = nextcord.Intents.default()
intents.members = True
Thats exactly what I did
Don't think it's much better
you mispelled intents then.....
I corrected it but I'm still getting an error
Let me see
The code itself?
Can anyone fix my code? import discord
client = discord.Client()
@client.event
async def on_ready():
print(f"We have logged in as {client.user}")
@client.event
async def on_message(message):
if message.author == client.author:
return
if message.content.startswith("Ping"):
await message.channel.send("Pong")
client.run("example-token")
ya show the code pls
Alright
import nextcord
from nextcord import Interaction
from nextcord.ext import commands
Intents = nextcord.Intents.default()
Intnets.Members = True
client = commands.bot(command_prefix = '!', intents=intnets)
@client.event
async def on_ready():
print("openDB is now online")
testingserverID = no
@client.slash_command(name = "hello", description="replies with hello", guild_ids=[testingserverID])
async def hellocommand(interaction: interaction):
await interaction.response.send.message("hello")
client.run('my bot token')
There isnt a specific action of timeout member in the audit logs i think
How do I send custom emoji in bot's embed? Tried 100 times, didn't worked. Let's say this 
Should be that huh?
replace Intnets.Members = True with Intents.members = True
Yeah
Okay let me try
Alright
Oh I see the typo
Again!?!?
intents=intnets do you see something
Fuck, another error.
ah fuck
that's the color of the embed
disnake.Color.green?
()
well probably, I'm not able to read the hex of that color
but I know you have to call green()
i bet that its an embed sent by dyno
Traceback (most recent call last):
File "openDB.py", line 8, in <module>
client = commands.bot(command_prefix = '!', Intents=intents)
NameError: name 'intents' is not defined
superuser@devastation:~/openDB$ still getting an error
what am i doing wrong?
@heady sluice
you decided to name intents with a capital I so you need to make it intents=Intents
or just rename Intents with a lowercase i
Ok
If this works, thanks
@torn sail it worked. Now it says "module object is not callable"
did you from discord import intents ?
Lemme check
No
What line do I put it in?
Line 4
?
!intents it should be something like this.
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 Members, Message Content, and Presences. These are needed for features such as on_member events, to get access to message content, 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.
I used import interaction on the first line
This is what I did in my ide
What did I do wrong now?
Lemme copy and paste the error
$udo, what's your experience with python?
This is my first time.....
Traceback (most recent call last):
File "openDB.py", line 8, in <module>
client = commands.bot(command_prefix = '!', intents=Intents)
TypeError: 'module' object is not callable
superuser@devastation:~/openDB$
I see it. Godamnit
you should learn python before making discord bots. Making discord bots is not a very good beginner project. Atleast learn the basic python syntax.
I learned from James s. He's a YouTuber
That's how I learned python
I fixed the error. Now it says message content intent is not enabled. How do I enable it?
developer portal
Alright
@slate swan it's already enabled
now enable it in your code by settings Intents.message_content to True
Alright
@slate swan its still not working: Traceback (most recent call last):
File "openDB.py", line 4, in <module>
Intents.message_content = True
NameError: name 'Intents' is not defined
superuser@devastation:~/openDB$
use whatever variable you used to define the Intents class
Wdym?
Oh, damnit I forgot how to define it
do intents.message_content = True
Alright
@slate swan that didn't work either. I'm still getting the same error
show your code
Ok
Traceback (most recent call last):
File "openDB.py", line 4, in <module>
intents.message_content = True
NameError: name 'intents' is not defined
superuser@devastation:~/openDB$
(this error has the line thats not working so you could see whats wrong)
code not error smh
import nextcord
from nextcord import Interaction
from nextcord.ext import commands
intents.message_content = True
Intents = nextcord.Intents.default()
Intents.members = True
client = commands.Bot(command_prefix = '!', intents=Intents)
@client.event
async def on_ready():
print("openDB is now online")
testingserverID = (my testing server id)
@client.slash_command(name = "hello", description="replies with hello", guild_ids=[testingserverID])
async def hellocommand(interaction: interaction):
await interaction.response.send.message("hello")
client.run('my bot token')
indentation AAAAAAA
do Intents.message_content = True just below Intents.members = True
does anyone know a good working library that still works for buttons? I found discord_components (but didn't manage to install it) and discord.ext with discord.ui but didn't work either
discord.py has buttons, forks have buttons too.
Now the bot just won't start at all
):
Do I need to send the code again?
bad indentation.
It didn't show an indentation error
It didn't do anything
there's no error, cause you're doing nothing
I typed python3 openDB.py
look at your code and analyse what it does
I looked
My code is fucking broken π
Everything looks normal
lemme do it for you
import nextcord
from nextcord import Interaction
from nextcord.ext import commands
# correct
Intents = nextcord.Intents.default()
Intents.members = True
# correct
client = commands.Bot(command_prefix = '!', intents=Intents)
# correct
@client.event
async def on_ready():
# when my bot is ready (online)
print("openDB is now online")
testingserverID = (my testing server id)
# add a slash command to it
@client.slash_command(name = "hello", description="replies with hello", guild_ids=[testingserverID])
async def hellocommand(interaction: interaction):
await interaction.response.send.message("hello")
# and run the bot
client.run('my bot token')```
so basically you're trying to run the bot when it starts running without running the bot 
@client.command(description="Admin permissions required. Purges a specified amount of messages.")
@commands.has_role("Administrative Staff")
async def purge(ctx, amount):
await ctx.channel.purge(limit=25)```
Can someone help with my purge command? Doesn't seem to work
elaborate "doesnt work"
nice indents baby
Like. It tries to run then it stops running.
No errors
credits to sudo
wasn't asking you but okay, am probably gonna go impatient if I help you
I'm sorry
oh god
It's ok, I really suck at python
lol
thats just pycharm warnings.
so it works huh?
run it and see.
I'm still unable to get this damn bot online πππππππ
testingserverID = (my testing server id)
# add a slash command to it
@client.slash_command(name = "hello", description="replies with hello", guild_ids=[testingserverID])
async def hellocommand(interaction: interaction):
await interaction.response.send.message("hello")
# and run the bot
client.run('my bot token')``` unindent this part of your code, and please learn basic python properly before making a discord bot
@slate swan is this how I make it purge the amount and 1 more message?
(so it deletes the trigger message)
indeed
Just press tab on the beginning of the code?
great
typehint amount in the purge function to int
!d discord.TextChannel.purge it only has kwargs iirc
await purge(*, limit=100, check=..., before=None, after=None, around=None, oldest_first=None, bulk=True, reason=None)```
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/latest/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/latest/api.html#discord.Permissions.read_message_history "discord.Permissions.read_message_history") permission is also needed to retrieve message history.
Changed in version 2.0: The `reason` keyword-only parameter was added.
Examples
Deleting botβs messages...
Hello?
So I should say int instead of amount?
!e py def function(argument: int): ... here i am typehinting argument to int, do the same for your amount arg
idk why i used !e but ok
Can I just keep it say amount
un-indent π
Fuck
async def purge(ctx, amount: int):
await ctx.channel.purge(limit=amount+1)
welcome
limit=amount+1 in the purge, amount: int in the function
that simple
??
i'll also suggest to check the amount variable, if its too much it can get ur bot ratelimited
Itβs pretty lenient, somewhat at least for purging
1 API call is equivalent to 100 deleted messages or less
Discord.py also handles it pretty well
I donβt know what the ratelimit headers are actually though so
there's also a limit for how old messages can be deleted too right?
2 weeks, it isnt enforced by the API itself rather this breaks the TOS iirc
await bot.get_channel(channel_id).send(embed=log_embed)
Any ideas?
because get_channel returns None and None has no attribute as send
yes
And how could I do that? I saw someone do it by importing app_commands but pylance doesnt seem to find it even after reinstalling discord.py with pip
First you need to install discord-py-slash-command via pip. Then from discord_slash import slash_command(ig)
Wait a second like this it not works
seconds
xd
first i found a mistake you need from discord_slash import SlashCommand and second after your bot=commands.Bot() you need slash=SlashCommand(bot, sync_commands=True)
If you want to add a command you need @gloomy cloak.slash ig (sry 4 ping)
isn't it earsier if I just switch to pycord?
ig xD
You can use discord.py v2
You would have to install straight from GitHub
the one from ralpzt? or sth like that
Yeah
pip install git+https://github.com/Rapptz/discord.py
do i have to uninstall the original discord.py?
HELLO
Probably
how convenient that i am named after the character /
'NoneType' object has no attribute 'guild'
@kindred oracle please donβt use discord-py-slash-commands that was suggested
I use that one from rapptz
I donβt think thatβs by rapptz
I saw it mulitple times and now master suggested it too
I mean discord.py from rappzt
Either way dpy has native slash commands without anything else
the one this command installs
Well discord-py-slash-commands is seperate, and you shouldnβt install it
sorry :/
Yeah thatβs the one Iβm talking about
Yep, just want to make sure people donβt use mediocre libraries
@commands.Cog.listener()
async def on_member_join(self,member:nextcord.Member):
embed=nextcord.Embed(color=0xfd9fa1, description= f'{member.mention}{member.name}{member.discriminator}\n**Account Age** \n {member.created_at}', title='Member Joined')
if member.avatar is None:
embed.set_thumbnail(url=f'{member.default_avatar}')
embed.set_footer(text=f'{member.guild}', url=f'{member.guild.icon.url}')
else:
embed.set_thumbnail(url=member.avatar.url)
embed.set_author(name=f'{member.name}', icon_url=f'{member.avatar.url}')
embed.set_footer(text=f'{member.guild}', icon_url=f'{member.guild.icon.url}')
embed.timestamp=datetime.datetime.utcnow()
await self.bot.get_channel(933978399280599080).send(embed=embed)
how do i fix this?
!d discord.Embed.set_footer
set_footer(*, text=None, icon_url=None)```
Sets the footer for the embed content.
This function returns the class instance to allow for fluent-style chaining.
Itβs icon_url= not url= @austere vale
Also why are you setting the footer and thumbnail multiple times
at the first embed.set_footer you typed url instead of icon_url
thank you
@flint heart :x: Your eval job has completed with return code 1.
001 | File "<string>", line 1
002 | https://paste.pythondiscord.com/ozilagacut
003 | ^^
004 | SyntaxError: invalid syntax
hello, ive got a question. Im currently working on a discord bot and I wanted someone to give me a suggestion whether I should make the the different functions of the bot in different files or just keep it all in the same file?
Personally, I would try to keep them all in one file
Much easier
Separate it as you think is fitting. All moderation in one file, fun commands in another. Everything in one file is bad practice
thanks
This is also where cogs and extensions come in, which lets you do nifty things like hot reloading on command
Hey I have a problem wiht the new discord.py, i get this error on the client.Clietn() line
Well whatβs the error say?
this
and what are they?
!intents
In the past it never needed anything
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 Members, Message Content, and Presences. These are needed for features such as on_member events, to get access to message content, 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.
A quick look at the docs would tell you that
You should take a look at this for all the major changes
question how can I link the different files together, following up from the previous question?
Yeah
a little recommendation: usepy intents = discord.Intents.all()instead ofpy discord.Intents.default()
can someone tell me how I can only release bot ranks in discord.py commands? So that the bot has ranks that you have to buy or have to be able to execute or use certain commands? I've been looking for quite a while and can't find anything about it on the internet, and I hope you can help me
you can answer me here or via dm
code?
add_cog and load_extension. For more info check the docs on that
Not a good idea
Only for development, for production I would restrict my intents to only what I need
at the end, you can set it to custom intents
but for convenience, discord.Intents.all() is best
(but you get rate-limited sometimes)
Right, but just make sure you do, or use the proper intents from the start so you donβt forget
So I tried making slash commands by a turorial but it doesn't seem to work
It just doesn't show up
I think I just remake it by the givan example in app_commands and we will see
yo robin have u ever made a discord bot dashboard with Quart ?
if yes can u tell me how to host it im using Hypercorn but i really dont know how to host it on a specific domain
it says the app is listening on "0.0.0.0:8000" :P
thanks
Hey
So I get this error:
which I don't really get because my bot has Admin perms
(token is invalid tho)
So I've had a look at https://github.com/Rapptz/discord.py/blob/master/examples/views/persistent.py and I'm a bit confused on where I set a custom_id. I'm calling my view herepy view = View(timeout=None) view.add_item(AlphaDropdown())and creating my dropdowns here https://github.com/SnowyJaguar1034/ModMail-FAQ/blob/master/classes/dropdown.py and I'd like both the Alpha and Beta dropdowns to be persistent. Do I set the custom_id as part of the view inilsiation in the command or in the Select's themselves?
Did you remember to add the application.commands scope to your invite link?
You need it in addition to the bot scope in order to update commands
Usually when people do this I always ask if your dashboard needs a websocket connection
I have made dashboards for my bot, but I believe quart is not the best way to do that
honestly i used quart bc of the quart_discord library
Yep
tysm
π
Hi, is there any way I can detect a ban & kick using an event?
you also have to enable a few intents in the discord developer portal
π
website dashboard
yo quick question
?
nvm i got the answer
ik that the .tk domain is free so im asking if "80.80.80.80" is the dns for dis domain
right?
oh you can just ignore that π€£
are you using freenom
ye lmao
yeah, you can ignore the ip
replit?
i didnt know that anyways tnx
nope
oh, then what IDE
railway(for hosting)
vscode
π
Import "discord" could not be resolved how do i fix that
yes
wait, discord or discord.py
lemme check
alright it worked
lol
lol
!d discord.on_member_remove
discord.on_member_remove(member)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Member "discord.Member") leaves a [`Guild`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Guild "discord.Guild").
If the guild or member could not be found in the internal cache this event will not be called, you may use [`on_raw_member_remove()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.on_raw_member_remove "discord.on_raw_member_remove") instead.
This requires [`Intents.members`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Intents.members "discord.Intents.members") to be enabled.
!d discord.on_member_ban
discord.on_member_ban(guild, user)```
Called when user gets banned from a [`Guild`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Guild "discord.Guild").
This requires [`Intents.bans`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Intents.bans "discord.Intents.bans") to be enabled.
yeah, i already found it but thanks
lol
This might be a strange question but is there any way to use buttons paginate the options in a select menu. Or any way around the 25 option limit
Sure, edit the select with new options
if message.content == "apples": await message.channel.send("i love apples")
my discord bot responds "i love apples" when a message is "apples"
how to make the bot always respond " i love apples " when the word "apples" is inside a sentence for example
"apples are delicious" , the bot won't respond to it unless the message is only "apples"
a help would be appreciated
"apples" in message.content
how to make sure it would respond even if the word "apples" has capitals in it, like "Apples" or "APPLES"
message.content.lower()
make sure the string is lowercase
hi someone can help me to make my bot ban and kick people?
use the ban and kick methods
member.kick()
member.ban()
pretty simple
you can add further logic if you want
await member.kick()
await member.ban()
thansk
goes in the code that contains the token of the bot ΒΏ
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'str' object has no attribute 'client'```???
code:
@client.command(aliases=['unbanuser'])
@commands.has_permissions(ban_members=True)
async def unban(ctx, self):
ban_list = await self.client.get_bans(ctx.message.server)
# Show banned users
await client.say("Ban list:\n{}".format("\n".join([user.name for user in ban_list])))
# Unban last banned user
if not ban_list:
await client.say("Ban list is empty.")
return
try:
await client.unban(ctx.message.server, ban_list[-1])
await client.say("Unbanned user: `{}`".format(ban_list[-1].name))
except discord.Forbidden:
await client.say("I do not have permission to unban.")
return
except discord.HTTPException:
await client.say("Unban failed.")
return```
"""
BAN COMMAND
""" @client.command(aliases=['banuser'])
@commands.has_permissions(ban_members=True)
async def ban(ctx, member : discord.Member, *, reason= "No reason was provided"):
await ctx.send(":white_check_mark: Banned them from the server")
await member.ban(reason=reason)```
```py
"""
Kick Command
"""
@client.command(aliases=['tempban'])
@commands.has_permissions(kick_members=True)
async def kick(ctx, member : discord.Member, *, reason= "No reason was provided"):
await ctx.send(":white_check_mark: Kicked them from the server")
await member.kick(reason=reason)```@mint cargo
the command wont register since its under the discord.Client.runmethod and discord.Client has no commands, you must use discord.ext.commands.Bot class
!d discord.ext.commands.Bot
class discord.ext.commands.Bot(command_prefix, *, help_command=<default-help-command>, tree_cls=<class 'discord.app_commands.tree.CommandTree'>, description=None, intents, **options)```
Represents a Discord bot.
This class is a subclass of [`discord.Client`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Client "discord.Client") and as a result anything that you can do with a [`discord.Client`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Client "discord.Client") you can do with this bot.
This class also subclasses [`GroupMixin`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.GroupMixin "discord.ext.commands.GroupMixin") to provide the functionality to manage commands.
Unlike [`discord.Client`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Client "discord.Client"), this class does not require manually setting a [`CommandTree`](https://discordpy.readthedocs.io/en/latest/interactions/api.html#discord.app_commands.CommandTree "discord.app_commands.CommandTree") and is automatically set upon instantiating the class.
async with x Asynchronously initialises the bot and automatically cleans up.
New in version 2.0.
hello
I would like to receive some help in a simple thing
My code is receiving an error because of intents.
The code I wrote
intents = discord.Intents.all()
bot = commands.Bot(command_prefix=prefix, intents=intents)
Intents enabled through Discord Developer Portal
The error I get:
discord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead.
Integrate your service with Discord β whether it's a bot or a game or whatever your wildest imagination can come up with.
message intents
stop ?ing, and you also need to turn them on to use them all.
scroll down you will find another intent named "Message Content Intent"
why would u use pycord, just use discord.py dev version on github
!d help
π im sure we have many client, bot and commands too 
Traceback (most recent call last):
File "C:\Users\Clicks\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "c:\Users\Clicks\Desktop\Timmy (smile)\bot.py", line 67, in unban
member_name, member_disc = member.split('#')
ValueError: not enough values to unpack (expected 2, got 1)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\Clicks\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\Clicks\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\Clicks\AppData\Local\Programs\Python\Python310\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: ValueError: not enough values to unpack (expected 2, got 1)``` what
code:
UnBan Command
unbans members from the discord server
"""
@client.command(aliases=['unbanuser'])
@commands.has_permissions(ban_members=True)
async def unban(ctx, *, member):
banned_users = await ctx.guild.bans()
member_name, member_disc = member.split('#')
for banned_entry in banned_users:
user = banned_entry.user
if(user.name, user.discriminator)==(member_name,member_disc):
await ctx.guild.unban(user)
await ctx.send(member_name + " has been unbanned!")
return
await ctx.send(member+" was not found")
"""
Purge Command
Purges amount of messages requested
"""
@client.command(aliases=['clear', 'prune'])
@commands.has_permissions(manage_messages=True)
async def purge(ctx, amount=11):
amount = amount + 1
if amount > 101:
await ctx.send('Can not delete more than 100 messages at once!')
else:
await ctx.channel.purge(limit=amount)
await ctx.send('Cleared the messages requested by {}'.format(ctx.author.mention))
await ctx.message.delete()```
not another lucas ban command 
stop - copying - code - from - youtube
read the error and traceback too, it kinda tells you what went wrong
Is your unban command looking like this?
for ban_entry in banned_users:
user = ban_entry.banned_users
if (user.name, user.discriminator) == (member_name, member_discriminator):
...
Lucas' unban only works for banning people via their name#discrim, now, this way is not wrong, but there are easier ways of unbanning people, e.g.:
# Unbanning by ID only (converting the ID to a object using discord.Object):
await ctx.guild.unban(discord.Object(id = id))
# converting the given user to a User object by type hinting:
async def unbean(ctx, user : discord.User, reason = None):
unbean 
lmao
I believe discord.User type hints only work for IDs if the user and the bot don't share a server, right?
!d discord.ext.commands.UserConverter if checks with these steps
class discord.ext.commands.UserConverter(*args, **kwargs)```
Converts to a [`User`](https://discordpy.readthedocs.io/en/latest/api.html#discord.User "discord.User").
All lookups are via the global user cache.
The lookup strategy is as follows (in order)...
what should I change?
you dont need to change anything, but you are using the command incorrectly as it is written.
I want it to work with ids as well
but, there could be much easier and efficient code.
^ you need to provide a user#tag, a mention or ID won't work
like?
like @slate swan's example.
if you want that to work with IDs, get some idea from the 2nd codeblock
^
where do i put the code he/she/they recommended
wherever you want.
stop ?ing, asking about what did you not understand can get you better help than a ? π
alright
"stop _HUHH_ing"
it seems like you have little to no knowledge about coding. i recommend you learn python basics before jumping into discord.py.
page.title += "something"
is there a way to role an undetermined amount of people in a slash command?
thank you, and it seems the math i was doing to retrieve the data from the excel file is wrong which might also fix my issue
why do i have to type the extra arguments to get the embed to work?
code:
@client.command(aliases=['helpunban'])
async def unbanhelp(ctx, embed, param):
embed=discord.Embed(title="Unban", description="Need some help with the unban command? We got you covered. read the instructions below and you should be good to go.", color=0x00ff11)
embed.set_author(name="Command Help:")
embed.add_field(name="Requirements", value="Ban Members Permission", inline=True)
embed.add_field(name="γ
€", value="User must actually be banned.", inline=True)
embed.add_field(name="Usage", value="t!unban (user)+(user#). Ex t!unban Clicks#8882", inline=True)
await ctx.send(embed=embed)```
nvm fixed the issue
I had to remove
embed, pram```
got a question:
downloading an image file takes 0.3s using aiohttp alone, but if i download the same image using aiohttp as part of a discord bot it takes 0.8s - 1s
why?
async def download(url):
t = time.perf_counter()
filename = "image" + str(random.randint(0, 5000)) + ".png"
try:
async with aiohttp.ClientSession() as session:
async with session.get(url) as response:
if response.status == 200:
content = await response.read()
async with aiofiles.open(filename, mode='wb') as f:
await f.write(content)
print(f"Time take to download: {time.perf_counter() - t}")
return filename
except Exception as e:
print(e)
what else if your bot doing with the image?
if its sending that image then it will depend on ur bot's ping. If ur bot's ping is 200ms then it will take .3s + .2+s to send it to discord
@client.command(aliases=[help, commands])
async def cmds(ctx):
helpCMD = discord.Embed(title="Commands", color=0xff3500)
helpCMD.add_field(name="vc/kick", value="Kicks a member of the server.", inline=False)
helpCMD.add_field(name="vc/ban", value="Bans a member of the server.", inline=False)
helpCMD.add_field(name="vc/mute", value="Mutes a member of the server.", inline=False)
helpCMD.add_field(name="vc/warn", value="Warns a member of the server.", inline=False)
helpCMD.add_field(name="vc/clear", value="Deletes an amount of messages in a specified channel.", inline=False)
helpCMD.add_field(name="vc/monkey", value="Generates a random picture of monke.",
helpCMD.add_field(name="vc/rank", value="Learn about our ranking system.")
await ctx.send(embed=helpCMD)
this works on literally all my other bots, why doesnt it work now?
and yes i didnt forget
# Client
client = commands.Bot(command_prefix='vc/')
client.remove_command('help')
(aliases=[help, commands]) , help and commands are supposed to be strs
You forgot quotes to make it a string in the decorator
@client.command(aliases=[help, commands])
^ ^ ^ ^
" " " "
oh yeah ""
@client.command(aliases=["help", "commands"])
async def cmds(ctx):
helpCMD = discord.Embed(title="Commands", color=0xff3500)
helpCMD.add_field(name="vc/kick", value="Kicks a member of the server.", inline=False)
helpCMD.add_field(name="vc/ban", value="Bans a member of the server.", inline=False)
helpCMD.add_field(name="vc/mute", value="Mutes a member of the server.", inline=False)
helpCMD.add_field(name="vc/warn", value="Warns a member of the server.", inline=False)
helpCMD.add_field(name="vc/clear", value="Deletes an amount of messages in a specified channel.", inline=False)
helpCMD.add_field(name="vc/monkey", value="Generates a random picture of monke.",
helpCMD.add_field(name="vc/rank", value="Learn about our ranking system.")
await ctx.send(embed=helpCMD)```
saying the last line is the problem
@bot.command()
@commands.has_role("Council")
async def addrole(ctx, role: discord.Role, *members: discord.Member):
rnames = [role.name for role in player.roles]
for member in members:
if str(role) in rnames:
await ctx.respond(f"<@{member.id}> already in {role}")
else:
await member.add_roles(discord.utils.get(ctx.guild.roles, name=role))
await ctx.respond(f":white_check_mark: {role} added to <@{member.id}>")
@addrole.error
async def addrole_error(ctx, error):
if isinstance(error, commands.MissingRole):
await ctx.send("You dont have the Council role.", ephemeral = True)
im not sure what i did wrong but when im doing a command to add role to multiple people, it isn't doing anything?
no errors
you forgot closing ) here
it just downloads and saves the file, theres no images being sent/uploaded. a listener picks up the url from the message and passes it on to the download function
hmm then its weird, it should take the same amount of time
@client.command()
@commands.has_permissions(timeout_members=True)
async def timeout(ctx: commands.Context, member: discord.Member, until: int):
handshake = await timeout_user(user_id=member.id, guild_id=ctx.guild.id, until=until)
if handshake:
return await ctx.send(f"Successfully timed out user for {until} minutes.")```
I get this error:
Traceback (most recent call last):
File "c:\Users\Clicks\Desktop\Timmy (smile)\bot.py", line 125, in <module>
@commands.has_permissions(timeout_members=True)
File "C:\Users\Clicks\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 1779, in has_permissions
raise TypeError('Invalid permission(s): %s' % (', '.join(invalid)))
TypeError: Invalid permission(s): timeout_members
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x0000026323E53C10>```
timeout_members is not a permission, or not named that in dpy
timeout_members = True is inexistent
use moderate_members = True
what is it named?
whats the difference
I just said that timeout_members is inexistent
The difference is that timeout_members does not exist
@bot.command()
@commands.has_role("Council")
async def addrole(ctx, role: discord.Role, *members: discord.Member):
rnames = [role.name for role in player.roles]
for member in members:
if str(role) in rnames:
print(f"<@{member.id}> already in {role}")
else:
await member.add_roles(discord.utils.get(ctx.guild.roles, name=role))
print(f":white_check_mark: {role} added to <@{member.id}>")
why does my command to role multiple people not return anything?
eww
you are printing, not ctx.replying or anything
also, wont *members convert everything to a string
oh does it
why not just await member.add_roles(role) since role is already a discord.Role after converting
you should typehint *members to list[discord.Member] too i think
!d discord.ext.commands.Greedy
class discord.ext.commands.Greedy```
A special converter that greedily consumes arguments until it canβt. As a consequence of this behaviour, most input errors are silently discarded, since it is used as an indicator of when to stop parsing.
When a parser error is met the greedy converter stops converting, undoes the internal string parsing routine, and continues parsing regularly.
For example, in the following code:
```py
@commands.command()
async def test(ctx, numbers: Greedy[int], reason: str):
await ctx.send("numbers: {}, reason: {}".format(numbers, reason))
``` An invocation of `[p]test 1 2 3 4 5 6 hello` would pass `numbers` with `[1, 2, 3, 4, 5, 6]` and `reason` with `hello`...
yeah that
File "c:\Users\Clicks\Desktop\Timmy (smile)\bot.py", line 125, in <module>
@commands.has_permissions(moderate_members = True)
File "C:\Users\Clicks\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 1779, in has_permissions
raise TypeError('Invalid permission(s): %s' % (', '.join(invalid)))
TypeError: Invalid permission(s): moderate_members
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x0000022885C87B50>```
what's your dpy version?
PS C:\Users\Clicks\Desktop\Timmy (smile)> py -3 -m pip install -U discord.py
Requirement already satisfied: discord.py in c:\users\clicks\appdata\local\programs\python\python310\lib\site-packages (1.7.3)
Requirement already satisfied: aiohttp<3.8.0,>=3.6.0 in c:\users\clicks\appdata\local\programs\python\python310\lib\site-packages (from discord.py) (3.7.4.post0)
Requirement already satisfied: typing-extensions>=3.6.5 in c:\users\clicks\appdata\local\programs\python\python310\lib\site-packages (from aiohttp<3.8.0,>=3.6.0->discord.py) (4.3.0)
Requirement already satisfied: yarl<2.0,>=1.0 in c:\users\clicks\appdata\local\programs\python\python310\lib\site-packages (from aiohttp<3.8.0,>=3.6.0->discord.py) (1.7.2)
Requirement already satisfied: attrs>=17.3.0 in c:\users\clicks\appdata\local\programs\python\python310\lib\site-packages (from aiohttp<3.8.0,>=3.6.0->discord.py) (21.4.0)
Requirement already satisfied: chardet<5.0,>=2.0 in c:\users\clicks\appdata\local\programs\python\python310\lib\site-packages (from aiohttp<3.8.0,>=3.6.0->discord.py) (4.0.0)
Requirement already satisfied: multidict<7.0,>=4.5 in c:\users\clicks\appdata\local\programs\python\python310\lib\site-packages (from aiohttp<3.8.0,>=3.6.0->discord.py) (6.0.2)
Requirement already satisfied: async-timeout<4.0,>=3.0 in c:\users\clicks\appdata\local\programs\python\python310\lib\site-packages (from aiohttp<3.8.0,>=3.6.0->discord.py) (3.0.1)
Requirement already satisfied: idna>=2.0 in c:\users\clicks\appdata\local\programs\python\python310\lib\site-packages (from yarl<2.0,>=1.0->aiohttp<3.8.0,>=3.6.0->discord.py) (3.3)
oh god
?
it's 1.7.3 smh
timeout is a 2.0^ thing
;-;
lemme update it
and I just asked for the version not the whole terminal satisfied requirments crap
π
lmao sorry
also, where tf does it say the version
Requirement already satisfied: discord.py in c:\users\clicks\appdata\local\programs\python\python310\lib\site-packages (1.7.3)
cuz pip install discord.py installs 1.7.3
so in the command arguments members: list[discord.Member]?
no
or use the greedy thing
Y E S
after changing this argument and not getting role from guild, the rest of the command remains the same then?
i'm new to this but wym
like half the stuff is redundant
like you can simply compare roles instead of names
and getting the role again while assigning it could return None and hence errors
oh do you mean
rnames = [role.name for role in player.roles]
yes and discord.utils.get
@bot.command()
@commands.has_role("Council")
async def addrole(ctx, role: discord.Role, members: commands.Greedy[discord.Member]):
for member in members:
if role in player.roles:
print(f"<@{member.id}> already in {role}")
else:
await member.add_roles(role)
print(f"{role} added to <@{member.id}>")
seems good
alright, thanks! let me try this out
async def addrole(...):
[await member.add_roles(role) for member in members if role not in player.roles else print(f"{member} already has the {role.name} role")]```
π while me
I want to add a new line to the embed without having to add another Field. how do I do so?
embed=discord.Embed(title="Help", description="List of all the commands")
embed.add_field(name="a1", value="a1", inline=False)
await ctx.send(embed=embed)```
why're you hardcoding the help command....
unless it's a slash help
im tryna get it to work for both slash commands and default
i want them both to look the same
helppppppppppp
also
when I attempt to use the command it shows this error
Ignoring exception in command None:
discord.ext.commands.errors.CommandNotFound: Command "help" is not found
\n in a string can be used to change lines
@client.command
async def help(ctx):
embed=discord.Embed(title="Help", description="List of all the commands")
embed.add_field(name="Moderation", value="a1" "a1", inline=False)
embed.add_field(name="Fun", value=f"test\ntest", inline=False)
await ctx.send(embed=embed)```
Ignoring exception in command None:
discord.ext.commands.errors.CommandNotFound: Command "help" is not found```
you didnt call command, its supposed to be @client.command()
go to sleep it's 1 am
12:59 AM*
round up bro
okimii you seriously should go to school
go to sleep
you aint rick rolling me bro
I know when that hotline bling
youve sent that mp3 file 3 times already and havent pressed it onceπ€
no
swear it ain't rickroll
okay let's get back on topic.
New topic: why is the codejam participants role colour so ugly π
idc lmao
yeah it's not, drake ftwww
emerald > any color
here's a UI I sketched the other day, doesn't emerald mmmmmhhhhh
it's close π
ok im gonna get tailwind color palette and replace it
ok there i'm sure that's emerald
put it in your bio
and your status
like?
the only thing i don't like while adding bots to bot list it making a description π
how?
red is the best color
Balls among us
ok
Complete the qualifier
cyan supermacy
Hi
hi
Very boring day today
Should I participate in code jam?
if you want sure, its a good challenge and can help your python skills
Hoe much time i have?
until july 13
Oh
#code-jam-announcements message info here!
I invited a bot to my guild and set his permission not to view the channel but still am able to use his slash commands is there a way to restrict that?
if you want go for it!
for the qualifier
the jam will start july 21
Some1?
I not understood what to do
server settings> integrations> your bot
end edit the permissions
Umm how can I restrict his commands in particular channel?
What permission I need to set off?
just go there and see. you will understand yourself
Hi π
yeah the instructions are a bit confusing but you can ask questions here: #code-jam-2022 and you should read the readme and understand it fully and follow the steps!
I did this
hi, sparkyπ
i didn't ask you to change role settings did i?
Hello :D
π
Umm but I want the bot to be allowed to run commands in some channels
did you even check it?
Yes I did it lists all the permission I have given to it
can you share a screenshot of what you have on ur screen rn
slide up.
you will see all bot commands listed there
you can choose what channels and roles can use those commands there
note: it doesn't change it for admins and owners
What all I see is this
slide up bruh
No such thing
up up
Scroll up
what kind of conversation is this
snowποΈποΈ
ive been alright, lets not get off topic here though. :D
nice
when a conversation gets moved to OT, 90% of the time the convo dies
I call it "the OT curse"
hi
facts
not really a code question but im wondering if anyone else uses the pandas library for their discord bot as well
im working on a project that requires a lot of pandas/discord py integration and im not really sure if a lot has been done between the two
hey all, I was hoping someone may be able to assist me, I started a python project a while ago that I think would be really beneficial, but having not looked at it recently and not being exceptionally good with python, I was hoping someone may be able to take a look and either help me complete it or would be willing to complete it for me? happy to negotiate a price if requested. I am basically up to the creation of the bot now and struggling with completing it
blockquote?
!rule 9
oh sorry, my bad!
should have read that. If someone is willing to help for free that's even more appreciative
what's the app about?
So basically the bot would allow a user to "subscribe" to a show in a database I have, so whenever a new episode is available for their subscribed show, they would receive a message/notification on discord letting them know. They would also be able to see and edit their current "subscriptions".
uhh nice
the project at this point has:
a working first run script, a working database (SQLite3), and I am able to get it to interact with discord and get next episode air information, but got stuck there
what's hard in that Β―_(γ)_/Β―
restart
was attempting to use a dropdown box with multiple choices to choose from and it got complicated, plus I started a new job that took all of my time away so I haven't been able to go back to it
nice
where are u stuck nowπ
It's been that long since I've looked at it, I'm trying to run it now to see where it is up to
did u save the code after editing perhaps it needs to be saved
i press ctrl s to do that right
im looking at examples for interactions in discord.py 2.0 and im wondering how to add a button to a message
like how to attatch an instance of button to a message
yes
check the dpy examples it's on their git
now that I've run requirements.txt, it's throwing a ridiculous amount of errors that I can't even begin to trace
πͺ¦
error: command errored out with exit code 1 for most of the requirements it seems
still not working :( when i try to run the file from cmd i get this error
=
OOOOH
π
ur probs till now we're typos = and not saving are u paying attention to what you are doing
the bot is online im so exited
π
exited
rip typos again
typoes happen
ok so now if I run the initial "first run" script, it allows me to enter all the data, but then once it's connected to discord and sonarr, it shows me an error relating to the main scrip that will run, and I'm not sure why it errors
feel free to dm me if you like Asher, heading out to dinner but will be home in an hour and a bit
indeed i remember forgetting an s in my file path and then spent 5 min figuring what went wrong
I've had worse, trust me
yesterday :kek:
π morning oki
Well you can use a db and make an initial subscribe command that takes the users snowflake id and the show, ofc you would need a check so a user doesnt make multiple accounts but can have multiple shows. then idk maybe an api can help with requesting a new episode for the show the user has subscribed to and have a background task running maybe making a request every day, and then have a command with a dropdown menu for the manipulation of the show column in your db
i havent slept and its 3amπ΅βπ«
πͺ¦
but good morningβ€οΈ
same it's 8 40 and I havent slept
π
i can sleep with you if that makes you feel any better π³
insomniac π
im sleeping already
π§ββοΈ
Hi
π
Code jam qualifier very difficult
for me it was hard to understand really
fail
Same
Why tf does embed not load
I just gave up doing qualifier project
would you like me to explain it to you in #ot0-psvmβs-eternal-disapproval ;))
I collapsed on the fucking street yesterday, don't ask me how I'm alive
Would that be cheating?
ive never collapsed in my life cuz im healthy
not really im just trying to make you understand what you have to do
π
Come
hehee
π
i still somehow got this error after creating a new repl
and copy pasta all the code one by one
You crashed into cycle or vehicle?
u ok?
*streets
or maybe you teleported into the backrooms and somehow got back here and you forgot
maybe she accidentally pressed the shutdown button π€£
anyone know how?
show code
π
:/
He mean to show start code
Hmm
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.
there isn't anything called e.is in that file 
oh wait
what do you expected e to be?
"collapsed" smh
line 99
Ryuga the Shepard π
@loud junco is is a reserved keyword, try doing e["is"] instead of e.is
okok


