#discord-bots

1 messages · Page 1130 of 1

pliant gulch
#

Wasn't this all meant to check if a user is nitro? (Or at least what you were wanting to do earlier). But either way, nitro users also don't always have an animated avatar or a custom banner 👁️ 👁️

placid verge
#

Why do you have both message and ctx in your on message function?

subtle spade
#

bruh why is it invis for me

placid verge
#

dude stop mass mention

subtle spade
#

ok chill

#

i dont see my thing so im confused i thought it didnt upload

subtle spade
fading marlin
#

on_message only takes 1 parameter: message which is of type discord.Message

subtle spade
#

i think ctx is better

placid verge
subtle spade
#

oh

placid verge
#

choose one and delete the other one

scarlet sorrel
#

what string is that for pip install and what string to import

slate swan
#

making a command inside on_message event kek

subtle spade
#

well how do you get the "variables"

#

with ctx

scarlet sorrel
placid verge
placid verge
subtle spade
#

bruh are you gonna help me or not

#

or roast me like crap

slate swan
placid verge
subtle spade
#

ok i removed my message thing

scarlet sorrel
subtle spade
#

now tell me how do get the "variables" with ctx

placid verge
subtle spade
#

its dif i think?

subtle spade
slate swan
placid verge
scarlet sorrel
subtle spade
#

and not roast me?

scarlet sorrel
#

ill just say fuck it and record everything from now on

placid verge
#

Telling someone to learn something isn't roasting 💀

placid verge
scarlet sorrel
#

most cases it is

placid verge
#

Ok, so don't learn basics about discord.py @subtle spade

#

is it good now?

subtle spade
#

be useful 😭

#

bruh

placid verge
#

💀

slate swan
slate swan
#

now create an async function and name it whatever you want... and add a channels or some variable with value bot.cache.get_guild_channels_view()

scarlet sorrel
#

thats what im tryna do but ofc that did not work at all

slate swan
#

💀 no way this works

scarlet sorrel
#

yea it dont

scarlet sorrel
#

ok ye ye

scarlet sorrel
slate swan
#

now create a for loop which iterates over the_variable.values(), get_guild_channels_view gets you a mapping of channel ids with channels objects

scarlet sorrel
#

well should i do the async or that

slate swan
#

inside

scarlet sorrel
slate swan
#

and assign it a variable?

scarlet sorrel
#

ok done

scarlet sorrel
#

ok cool done

slate swan
#

what does your code look like rn?

paper sluice
#

interactions in hikari feel faster than dpy ( maybe they are )

scarlet sorrel
slate swan
#

nothing of that will work.

slate swan
scarlet sorrel
slate swan
#

no

scarlet sorrel
#

ok i removed it

slate swan
unkempt canyonBOT
#
Did you mean ...

» string-formatting
» for-else

slate swan
#

oof, well thats not how you use a for loop

scarlet sorrel
#

cuh

#

this good?

#

@slate swan

slate swan
#

yes.

scarlet sorrel
#

hundreds of people use my bot

slate swan
#

now check the instance of value ```py
if isinstance(value, hikari.GuildTextChannel):

lethal drift
#

talking about me lmao

heady sluice
lethal drift
scarlet sorrel
heady sluice
#

now create a for loop which iterates over the_variable.values() doesn't change anything on how for loops work

#

but I don't wanna get into this argument right now

slate swan
#

now create a for loop which iterates over the_variable.values(),
for variable.values()

totally not what i said

scarlet sorrel
#

it is

heady sluice
#

so let's just let it slide

slate swan
#

you know what iterate means right?

lethal drift
#

oof

#

for i in..

slate swan
#

¯_(ツ)_/¯

heady sluice
#

this is the exact reason people who have never learned python are not getting help in the discord.py server

scarlet sorrel
#

try tellling python "on no i meant make a varaible in a for loop to iterate over variable.values() not do that, its ok still do what i told you you'l work it out im sure"

slate swan
#

python linters would already have been shouting at you if you used one. so dont blame anyone

scarlet sorrel
#

the hell is a linters

heady sluice
#

exactly

scarlet sorrel
paper sluice
slate swan
#

"creating a for loop" includes the for and in statement already.

scarlet sorrel
heady sluice
#

lmao

lethal drift
#

oooooooof

slate swan
#

anyways.

paper sluice
#

I wish i was as good as you

slate swan
#

back to topic if you wanna continue

scarlet sorrel
#

i disabled error highlighting and warnings highlighting because there are over a thousand of those 2 combined

scarlet sorrel
slate swan
#

mypy strict typing with 0 errors 😏 😏

slate swan
#

did you add that isinstance part?

scarlet sorrel
crystal pelican
#

wyd

lethal drift
#

Tried this and it still isn't working with larger intervals 😅

crystal pelican
#

tf is that backround Skull

paper sluice
scarlet sorrel
# lethal drift

duuuude im sorry but hoooowwwww do you read your code with that howwwww

slate swan
unkempt canyonBOT
#

wait_for(event, /, *, check=None, timeout=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Waits for a WebSocket event to be dispatched.

This could be used to wait for a user to reply to a message, or to react to a message, or to edit a message in a self-contained way.

The `timeout` parameter is passed onto [`asyncio.wait_for()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for "(in Python v3.10)"). By default, it does not timeout. Note that this does propagate the [`asyncio.TimeoutError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.TimeoutError "(in Python v3.10)") for you in case of timeout and is provided for ease of use.

In case the event returns multiple arguments, a [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.10)") containing those arguments is returned instead. Please check the [documentation](https://discordpy.readthedocs.io/en/latest/api.html#discord-api-events) for a list of events and their parameters.

This function returns the **first event that meets the requirements**...
lethal drift
scarlet sorrel
paper sluice
scarlet sorrel
#

i said may

paper sluice
#

i clarified it

lethal drift
#

Don't know what else to tell ya lol

#

At least I can go about not having errors

crystal pelican
scarlet sorrel
lethal drift
paper sluice
crystal pelican
slate swan
# scarlet sorrel

now just add a try except clause with value.fetch_message and keep doing it until it gives you a message object basically ```py
btca = ...
message = None
for value in btca.values():
if isinstance(...):
try:
message = await value.fetch_message(id)
break
except hikari.NotFound: pass

slate swan
lethal drift
# paper sluice what exactly is not working?

if i set the timeout to anything higher than 30 minutes, it tends to not come back with anything as if there's a maximum I can set. When I set to small times (5-10 minutes), it works perfectly

lethal drift
slate swan
paper sluice
#

i understand

paper sluice
crystal pelican
#

ya exactly

lethal drift
#

It's a dead chat reviver, it pings after not receiving a message after a set time. Particularly 1 hour

scarlet sorrel
lethal drift
#

it works when the time interval is short though

#

but seems to cancel the task after a set time

crystal pelican
#

What do you have so far for the code

slate swan
paper sluice
crystal pelican
#

ya that works

scarlet sorrel
slate swan
#

message.channel.send

lethal drift
#

How would it go about checking the time automatically though. I used on_message cause that is user controlled and it could tell when a message it sent to a certain channel

scarlet sorrel
#

await on_ready()

lethal drift
#

async def on_ready()?

slate swan
paper sluice
scarlet sorrel
slate swan
slate swan
lethal drift
#

took me so long to get somewhere with this lol

scarlet sorrel
slate swan
#

oh ok

rare saddle
#

How to understand what the user entered into the parameter is a link or not?

paper sluice
scarlet sorrel
slate swan
rare saddle
slate swan
# scarlet sorrel

but why did you use MemberCreateEvent when i asekd for hikari.StartedEvent

slate swan
paper sluice
scarlet sorrel
scarlet sorrel
slate swan
#

async def on_ready(_ ):should do

scarlet sorrel
paper sluice
#

its been sometime since i have seen a function like def foo(_)

slate swan
#

bot.run() in the end

scarlet sorrel
#

ah

#

dude i only do what you tell me, last time i didnt you did not like it

slate swan
paper sluice
swift pumice
#

how can i make a reaction role command? like if someone reacts to a message the user will be given a role

slate swan
#

looli when ur documentation is bigger than the actual code

paper sluice
slate swan
#

tbh button roles with persistent views sounds more fun

scarlet sorrel
#

@slate swan AttributeError: module 'hikari' has no attribute 'NotFound'

#

is this my fault too

#

or is that actually something weird

slate swan
#

!d discord.NotFound i mixed it with this

unkempt canyonBOT
#

exception discord.NotFound(response, message)```
Exception that’s raised for when status code 404 occurs.

Subclass of [`HTTPException`](https://discordpy.readthedocs.io/en/latest/api.html#discord.HTTPException "discord.HTTPException")
slate swan
#

what you wanna do elias?

swift pumice
#

i want that it will send a message in a specific channel

#

but i couldnt find anything

slate swan
#

you can get the channel and then send the message there

#
channel = bot.get_channel(id)
await channel.send("uwu")
swift pumice
#

thank you

scarlet sorrel
#

@slate swan it gets to except hikari.NotFoundError: and then never gets a good value

#

it takes like 0.3 seconds per loop so do you think it will just take a really really really really long like

scarlet sorrel
#

i think it will just take forever...

slate swan
#

depends on the number of channels your bot can see

scarlet sorrel
#

how do i check

slate swan
#

len() on the bot.cache.get_gu...

scarlet sorrel
slate swan
#

where did you use it

scarlet sorrel
#

it prints "0"

slate swan
#

1 moment

scarlet sorrel
#

ping me when you come back btw

swift pumice
#

how can i make that the bot reacts to his own message?

#

await ctx.message.add_reaction("👶") my current

#

how can i make that it reacts to his own message? like it reacts to my message

barren osprey
#

slap the bot as if you are an italian mechanic

swift pumice
#

thanks

paper sluice
swift pumice
#

okay ty

hushed galleon
paper sluice
hushed galleon
#

wait when did interaction do that

#

i thought that was the purpose of original_message()

paper sluice
hushed galleon
#

are you sure? the dpy 2.0 docs dont describe it like that

#

e.g. if a message had a component that was clicked on

swift pumice
#

@paper sluice ```@bot.listen
async def on_reaction_add(reaction):
guild = bot.get_guild(932688393832390686)
member = guild.get_member(988529250493661184)

if member.reaction_add():
    role = nextcord.utils.get(guild.roles, id=988529250493661184)
    await member.add_roles(role)
swift pumice
# swift pumice <@704927892714291210> ```@bot.listen async def on_reaction_add(reaction): gu...
async def message(ctx):
    channel = bot.get_channel(985970666643816498)
    react = await channel.send("How old are you?(13-15)[React to the message]")
    await react.add_reaction("👶")

@bot.listen
async def on_reaction_add(reaction):
    guild = bot.get_guild(932688393832390686)
    member = guild.get_member(988529250493661184)

    if member.reaction_add():
        role = nextcord.utils.get(guild.roles, id=988529250493661184)
        await member.add_roles(role)
``` my full command
hushed galleon
#

listening for reactions as part of a command can be done in a simpler manner using Client.wait_for(event), rather than dedicating an entire listener to it

paper sluice
heady sluice
#

most music bots download music from youtube or spotify, of which both platforms have banned bot automatization

#

we do not want to know about that

hushed galleon
# hushed galleon listening for reactions as part of a command can be done in a simpler manner usi...

@swift pumice an example of what i described earlier: ```py
@bot.command()
async def handshake(ctx):
message = await ctx.send('Shake my hand!')
await message.add_reaction('🖐️')

def check(reaction, user):
    # only accept a reaction with the same emoji and on the same message
    return reaction.emoji == '🖐️' and reaction.message == message

reaction, user = await bot.wait_for('reaction_add', check=check)
await ctx.send(f'Thank you {user.mention}!')``` in your case you can write the command with a similar pattern, just adding their role afterwards
swift pumice
simple gulch
#

Hello. I have a discord bot that uses a web scraper. Recently the website we use decided it would like to confuse us all by randomizing the class we draw from? What is the best way to have a wildcard or something for the class. My part of my bot looks something like this currently.
answerBody = soup.find(class_="answer-given-body")

#

However now they have it like this styled__QnaHtmlContent-oj1dsq-41 duUzTZ where those last digits are random based on the search?

subtle spade
#

yeah so everything works but idk how to do the for element in swearWordsList: thing

#

i want it to loop but each time the swearWords var is gonna be a item in swearWordsList

sage otter
#

you need to indent your stuff

subtle spade
sage otter
#

bruuu

subtle spade
#

so yes or no

sage otter
#

no because thats not how you learn

subtle spade
#

every time i get here i get bullied for some reason

sage otter
#

If you cant fix something as simple as indentation i have no doubt in my mind you wouldnt understand a solution that I'd give to you

subtle spade
#

bro can you just help me without arguing

sage otter
#

Im not bullying im just telling you the truth

subtle spade
#

you seem to help everyone else

sick birch
#

He is helping

subtle spade
#

yeah tottally

sick birch
#

We expect a certain level of skill when it comes to giving help

subtle spade
sick birch
#

!resources that's why these are here

unkempt canyonBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

sick birch
#

Would be well worth your time to give those a shot first, then come back to something a little more complex such as discord bots

subtle spade
#

if u decided to learn C# noone would "tell the truth"

slate swan
#

if you're "totally" new discord.py is not a library to work with.

subtle spade
#

yeah i just wanna make a simple bot for my friend

sick birch
#

So you don't stump yourself on relatively simple problems, and you can make better use of your time and solve more interesting/harder problems instead of small, syntax issues

#

Then knowing a very basic amount of Python should cut it

subtle spade
#

can you help me tho? and i won't appear here again

sick birch
#

We already did, fix your indentation

subtle spade
#

oh cmon

sick birch
#

I'm not sure what else you want me to tell you

#

We've given you the solution to your issue

subtle spade
#

instead of "telling" me the truth

slate swan
#

!indent read this.

unkempt canyonBOT
#

Indentation

Indentation is leading whitespace (spaces and tabs) at the beginning of a line of code. In the case of Python, they are used to determine the grouping of statements.

Spaces should be preferred over tabs. To be clear, this is in reference to the character itself, not the keys on a keyboard. Your editor/IDE should be configured to insert spaces when the TAB key is pressed. The amount of spaces should be a multiple of 4, except optionally in the case of continuation lines.

Example

def foo():
    bar = 'baz'  # indented one level
    if bar == 'baz':
        print('ham')  # indented two levels
    return bar  # indented one level

The first line is not indented. The next two lines are indented to be inside of the function definition. They will only run when the function is called. The fourth line is indented to be inside the if statement, and will only run if the if statement evaluates to True. The fifth and last line is like the 2nd and 3rd and will always run when the function is called. It effectively closes the if statement above as no more lines can be inside the if statement below that line.

Indentation is used after:
1. Compound statements (eg. if, while, for, try, with, def, class, and their counterparts)
2. Continuation lines

More Info
1. Indentation style guide
2. Tabs or Spaces?
3. Official docs on indentation

sick birch
#

That's spoonfeeding and we don't really do that here

subtle spade
sick birch
#

If I did, you wouldn't learn indents and you'd be back with the next indent problem

subtle spade
#

im going to ask someone else

#

thanks robin ig?

sick birch
sage otter
#

Also hi @sick birch. Meant to say hi when you came in

sage otter
#

or are staff not allowed?

sick birch
#

We are, but I'm a bit busy at the moment, what with the bot pin migration project and whatnot

slate swan
#

pithink robin whats the bot pin migration?

#

like ik all the information in the pins is getting shifted to the site, but is there more?

frail notch
#

hi there my bot won't send emojis 🤔

    await ctx.send("<:verification:emojiid here>")```
The code above sends the following:
slate swan
#

use the escape name of the emoji

frail notch
slate swan
#

use its object then

slate swan
frail notch
#

thats what i did

#

thats how i did it

slate swan
#

!d discord.Client.get_emoji

unkempt canyonBOT
#

get_emoji(id, /)```
Returns an emoji with the given ID.

Changed in version 2.0: `id` parameter is now positional-only.
slate swan
#

it can be used as long as you're consistent between the choice of spaces and tabs, you gotta choose only one 1 tho

frail notch
#

ok

robust summit
#

tabs over spaces /rant_complete

slate swan
#

agreed.

robust summit
#

I don't know if different IDEs see whitespace differently, but VSCode is always yelling at me about indentation in Python (other languages, it's only aesthetic) so if I have to indent, I'm going to do it with fewer keystrokes.

sick birch
grim oar
#

Just black your stuff bro

robust summit
slate swan
grim oar
sick birch
slate swan
#

*days

lethal drift
#

@paper sluice Eventually got it to this and it works

frail notch
lethal drift
frail notch
#

thanks

sick birch
#

Maybe just vim or emacs with compositor transparency enabled

#

I do something similar but with vscode, picom transparency and background blur. Adds a nice effect imo

#

Always

#

Lol.. maybe you don’t have an artistic eye for that, which isn’t bad because I don’t either haha

rare saddle
#

How to get node.identifier from main.py file of on_wavelink_node_ready function in another file?

sick birch
#

I find it helpful to take inspiration from others dot files

sage otter
#

It would probably be better to put the listener in the same file

lethal drift
#

Pycharm

sage otter
#

The superior ide 👌

lethal drift
#

Do you prefer tkinter or Kivy? @sage otter

sage otter
#

Idek what the second one is.

lethal drift
#

Hmm, i don't know how to describe it to make it sound different than the first lol

slate swan
sage otter
#

Haven’t got to use it yet so idk anything about it

slate swan
#

Hey! I'm creating a bot that controls a command panel, but am currently running into some issues I don't know how to fix.

from pyautogui import *
import pyautogui
import win32gui
import time
import clipboard
import discord
from discord.ext import commands

botToken = "No"
client = commands.Bot(command_prefix='!', help_command=None)

fileLocation = "C:/Users/Admin/Downloads/Program.exe"

def screenshot():
    with open("hwnd.txt", "r") as file:
        hwnd = int(file.read())
    win32gui.SetForegroundWindow(hwnd)
    x, y, x1, y1 = win32gui.GetClientRect(hwnd)
    x, y = win32gui.ClientToScreen(hwnd, (x, y))
    x1, y1 = win32gui.ClientToScreen(hwnd, (x1 - x, y1 - y))
    pyautogui.screenshot("screenshot.png",region=(x, y-27, x1, y1+27))

@client.command()
async def start(ctx):
    if clipboard.paste != fileLocation:
        clipboard.copy(fileLocation)
    pyautogui.hotkey('winleft', 'r')
    time.sleep(0.5)
    pyautogui.hotkey('ctrl', 'v')
    pyautogui.press("enter")
    time.sleep(0.5)
    with open("hwnd.txt","w") as file:
        hwnd = win32gui.FindWindow(None, fileLocation.replace("/","\\"))
        file.write(str(hwnd))
    time.sleep(0.1)
    screenshot()
    time.sleep(0.1)
    await ctx.channel.send("Screenshot:", file=discord.File("screenshot.png"))

client.run(botToken)

Error:

RuntimeWarning: coroutine 'Command.__call__' was never awaited
  screenshot()
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
flat solstice
#

I'm not great with *args and **kwargs; does someone mind explaining to me what I'm doing wrong here?```py
class BetaDropdown(Select):
def init(self, options: list[SelectOption]):

ERROR:discord.ui.view:Ignoring exception in view <AlphaDropdownView timeout=180.0 children=1> for item <AlphaDropdown placeholder='Select a topic...' min_values=1 max_values=1 options=[<SelectOption label='Common Troubleshooting for users' value='1.0' description='Solutions for issues users need to fix from their end' emoji=None default=False>, <SelectOption label='How To setup certain aspects of ModMail' value='2.0' description='Setting the bot up, Using a different category, and more' emoji=None default=False>, <SelectOption label='ModMail Premium' value='3.0' description='Topics related to Modmail premium' emoji=None default=False>, <SelectOption label='Useful Links' value='4.0' description=None emoji=None default=False>, <SelectOption label='How do I use X command' value='5.0' description='Examples on how to use each of the configuration commands' emoji=None default=False>] disabled=False>
Traceback (most recent call last):
File "C:\Users\Teagan\Documents\Coding\FAQ\env\lib\site-packages\discord\ui\view.py", line 414, in _scheduled_task
await item.callback(interaction)
File "C:\Users\Teagan\Documents\Coding\FAQ\classes\dropdown.py", line 87, in callback
view=BetaDropdownView(chosen_sub_options),
TypeError: BetaDropdownView.init() takes 1 positional argument but 2 were given```

sick birch
#

Also tip, don't use time.sleep() use asyncio.sleep() instead

slate swan
sick birch
#

I'd rather see that

#

Longer errors are usually more descriptive of the issue

slate swan
#
c:\Users\Admin\Downloads\test.py:35: RuntimeWarning: coroutine 'sleep' was never awaited
  asyncio.sleep(0.1)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Ignoring exception in command start:
Traceback (most recent call last):
  File "C:\Users\Admin\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\Admin\Downloads\test.py", line 36, in start
    await screenshot()
  File "C:\Users\Pokim\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 374, in __call__
    return await self.callback(*args, **kwargs)
TypeError: screenshot() missing 1 required positional argument: 'ctx'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\Admin\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\Admin\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\Admin\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: TypeError: screenshot() missing 1 required positional argument: 'ctx'`
paper sluice
#

yup pycharm does

pliant gulch
#

I just sometimes make my compositor make my terminal transparent

#

Bam instant custom background

paper sluice
#

lol

#

can't you just set backgrounds?

pliant gulch
#

I can but that makes me need to edit the config, then reload nvim

#

I can always just make a key bind in Lua that manually makes the background of nvim transparent

#

But I’m just lazy

paper sluice
#

oh lol

#

whats the keybind to zip code?

paper sluice
#

something like that

sage otter
paper sluice
flat solstice
pliant gulch
paper sluice
#

thanks :)

pliant gulch
#

opening is z+o btw ^ you should def map binds to this to make it easier

sick birch
paper sluice
#

right, thanks 😄

slate swan
sick birch
#

That makes sense

sage otter
flat solstice
sage otter
#

you dont need the **kwargs

#

in neither the init or super init

#
class TestSelect(Select):
    def __init__(self, options: list[discord.SelectOption]):
        super().__init__(placeholder="Test", options=options)

something like this would work

flat solstice
harsh briar
#

Hello, how can i have my bot online forever without having to keep the .py file open

sage otter
#

Theres a thread for this channel called discord-bot-hosting that you can take a look at

lethal drift
hardy yoke
shell wing
#

how many buttons can i add in a single message ?

tough slate
#

how to mention a specific role without using ctx?

desert heart
#

Do you know the ID of that role?

tough slate
#

Yes

#

@desert heart

desert heart
#
await channel.send("<@&400499713570242571>")
#

That number should be the role's ID

tough slate
#

Its supposed to ping in an embed description

#

although its not IMPORTANT that it does it there i suppose

desert heart
#

Same idea. Just put a string like that in the embed.

tough slate
#

I thjink ive tried that but ill try again

tough slate
#

wait im a fool

#

It says deleted-role even though I currently have the role

desert heart
#

Are you sure the ID is correct

tough slate
#

Ah i think at some point i used the ID of the message with the ping in it and not the role

#

Thanks @desert heart . It works now

slate swan
#

hey @sick birch ( sorry for the ping ), i was wondering if it was possible to build the PyDis site locally? Also, is there some limit for the information to mention in the guides? cause im covering almost all the important parts, including basic things related to the Discord API itself

slate swan
#

yessir

desert heart
slate swan
#

tysm

robust fulcrum
#

I am not able to understand how can I do it

slate swan
robust fulcrum
#

Like I used the poll command and message I'd is 45584938 and I store into variable

#

And if I use poll command again and store 73883838 message id into variable the first one ID would stop working

#

If i want every I'd works until my bot stops or reload

robust fulcrum
shrewd apex
#

u have to fetch the message in raw reaction add event using message id

robust fulcrum
slate swan
dusky pine
#

ash u not joining codejam?

robust fulcrum
slate swan
slate swan
robust fulcrum
#

I'll try postgresql

#

Let me get it's info first

slate swan
#

it's harder than sqlite fyi

maiden fable
slate swan
#

mongoDB is bad

maiden fable
#

Why would u say so....?

slate swan
#

just feels like it

maiden fable
#

....

slate swan
#

lmao anyways, if you wanna have a bot in production, idts that 512 mb of ram will be fine forever

#

storage*

#

my bad

maiden fable
#

As long as u ain't storing data locally, that's fine. I mean, Python files are hardly a few KBs

slate swan
#

mhm, so what's your point?

maiden fable
#

That 512 MB is enough as long as u ain't storing data locally in the form of files or a db

slate swan
#

mhm

#

Hunter smarty

robust fulcrum
#

@slate swan there is password port and server thing in postgresql

#

Idk how could I get password

dusky pine
#

ash it's your time to teach him postgres

#

wake up 😄🎉

robust fulcrum
slate swan
robust fulcrum
#

It's 10:37 am for me

#

But do i need to download any app for postgresql

#

I'll use sqlite

#

Postgresql is confusing

dusky pine
#

why'd you even try using postgres when you're not familiar with sqlite yet

robust fulcrum
#

I am very cunfused for the poll comamnd

#

It's very hard to make

#
    @commands.command()
    async def poll(self,ctx,question,options:int):
        if options <= 10 and options > 1:
            await ctx.send("Type the name of options accordingly",delete_after=3)
            optionlist = []
            option = 1
            def check(msg):
                return msg.author.id == ctx.author.id and msg.channel.id == ctx.channel.id
            while option <= options:
                option = option+1
                await ctx.send("enter the name of option",delete_after=3)
                optname = await self.bot.wait_for('message',check=check, timeout=20)
                await optname.delete() 
                optname = optname.content
                optionlist.append(optname)
            queno = len(optionlist)
            sends = questions(queno,question,optionlist)
            react = await ctx.send(embed=sends)
            await reaction(react,options)
#

Anyone pls help

slate swan
robust fulcrum
slate swan
robust fulcrum
#

I told command i easy

#

Not the graph

slate swan
#

graph?

robust fulcrum
#

ᕙ( ͡◉ ͜ ʖ ͡◉)ᕗ

slate swan
#

ew

robust fulcrum
#

Asher's challenge

slate swan
#

weirdest

robust fulcrum
#

I am so confused

#

Idea!

#

I can make a seprate comamdb for the graph

#

Like

graphical and reply to the poll comamnd and get graph

#

It would be easy to make

#

@shrewd apex

slate swan
robust fulcrum
slate swan
robust fulcrum
#

@slate swan is there any way to get reaction count of a specific emoji on a message?

slate swan
#

!d discord.Reaction.users

unkempt canyonBOT
#

async for ... in users(*, limit=None, after=None)```
Returns an [asynchronous iterator](https://docs.python.org/3/glossary.html#term-asynchronous-iterator "(in Python v3.10)") representing the users that have reacted to the message.

The `after` parameter must represent a member and meet the [`abc.Snowflake`](https://discordpy.readthedocs.io/en/latest/api.html#discord.abc.Snowflake "discord.abc.Snowflake") abc.

Changed in version 2.0: `limit` and `after` parameters are now keyword-only.

Examples

Usage...
slate swan
#

^

shrewd apex
robust fulcrum
#

Hmmm

robust fulcrum
shrewd apex
#

make

#

i dont mind

robust fulcrum
#

Ok

shrewd apex
#

u can call the graph command in the poll command :kek:

robust fulcrum
#

How to get message_id the of the message to which we reply?

shrewd apex
slate swan
#

!d discord.MessageReference needs to be here

unkempt canyonBOT
#

class discord.MessageReference(*, message_id, channel_id, guild_id=None, fail_if_not_exists=True)```
Represents a reference to a [`Message`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Message "discord.Message").

New in version 1.5.

Changed in version 1.6: This class can now be constructed by users.
robust fulcrum
#

Ohk

slate swan
#

hm yeah its message.reference.message_id

robust fulcrum
#

Oh k

#

@shrewd apex like if i replied to poll comamnd and did the graph comamnd how can I get count of options?

shrewd apex
#

rip bro stop pinging every 5 lines

robust fulcrum
robust fulcrum
#

The number of options (i.e reactions)

#

Like number of options to question are there

robust fulcrum
slate swan
#

How to get message_id the of the message to which we reply?
?????

robust fulcrum
slate swan
#

yes.

robust fulcrum
#

Ok

left idol
#

how would i make a custom cooldown for a command?

#

i.e. regular members have 10s and specific role has none

robust fulcrum
slate swan
#

click on the link

robust fulcrum
dusky pine
#

do you have the slightest clue of what properties and/or variables are 😭

slate swan
robust fulcrum
#

Do i need to use the async thing

slate swan
#

ofcourse

#

the second one would be easier for you tho*

#

or wait

#

!d discord.Reaction.count just use this @robust fulcrum

unkempt canyonBOT
robust fulcrum
slate swan
#

no

robust fulcrum
#

Do i need to give message id

dusky pine
#

it's not a function

robust fulcrum
#
number = discord.Reaction.count(emoji='😵',message=127383838)

Is it correct now?

dusky pine
#

your pfp is gone

robust fulcrum
#

Whats the correct way to do that then?

vale wing
#

@slate swan add python to PATH

#

Easy method is to reinstall python with "Add Python to PATH" checkmark, a bit more difficult is add it manually

#

Try py -m pip

#

python3 -m pip

#

If still doesn't work you probably did that wrong

#

Did you even install the interpreter

#

Python interpreter yes

#

Yes

#

Uninstall it and install again with the checkmark

slate swan
#

did you delete the old installation?

#

python

#

cool, now install nextcord and try

iron sorrel
#

is there a way i can make certain events get triggered lets say at 7pm exactly everyday, using discord package?

sage otter
#

you can use tasks

#

and Bot.dispatch()

iron sorrel
#

to dispatch an event?

sage otter
#

yea

iron sorrel
#

and make my own event your saying?

sage otter
#

wdym by make your own event

#

whats your implementation?

iron sorrel
#

i know tasks but

#

how do i schedule them so they trigger at

#

lets say sunrise sundown, and change some emoji in the server

vale wing
#

What IDE do you have @slate swan

vale wing
sage otter
#

Ill send a quick example from dpy

#

Actually nevermind

#

if your using dpy 2.0

#

The tasks framework was updated

iron sorrel
iron sorrel
sage otter
#

ouch

vale wing
#

CTRL + SHIFT + P -> select interpreter

sage otter
#
# interval must be a divisor of 24 hours to function predictably
@tasks.loop(hours=6)
async def task_at_specific_times():
    ...

@task.before_loop
async def wait_until_time():
    # this will use the machine's timezone
    # to use a specific timezone use `.now(timezone)` without `.astimezone()`
    # timezones can be acquired using any of
    # `datetime.timezone.utc`
    # `datetime.timezone(offset_timedelta)`
    # `pytz.timezone(name)` (third-party package)
    now = datetime.datetime.now().astimezone()

    # `task_at_specific_times` here should be replaced with the name of your task function
    task = task_at_specific_times
    interval = datetime.timedelta(hours=task.hours, minutes=task.minutes, seconds=task.seconds)

    # insert one of the times at which the task should run
    # if it should run every 8 hours at 2:00/10:00/18:00, any of those times can be given
    next_run = now.replace(hour=3, minute=0, second=0)

    while next_run > now:
        next_run -= interval
    next_run += interval

    await discord.utils.sleep_until(next_run)

Heres the example they provided for non 2.0 then

iron sorrel
#

alright thanks

vale wing
#

Restart IDE

#

And yeah you better use venv

robust fulcrum
shrewd apex
#

rip nvm it's fine atleast u tried

robust fulcrum
shrewd apex
#

just send a ss

robust fulcrum
#

ss?

#

Whats ss

dusky pine
robust fulcrum
#

Ok

robust fulcrum
#

Nvm the question

shrewd apex
#

nais Ashley for the win🎉

dusky pine
#

i vote ashley

#

:p

robust fulcrum
#

Any new challenge?
Don't give a hard one

#

🥺

shrewd apex
#

rip i am out of ideas ask others

robust fulcrum
#

@dusky pine any challenge for me?

shrewd apex
#

u play any games on mobile?

dusky pine
robust fulcrum
shrewd apex
#

or any online games

dusky pine
#

API to access bot's statistics including user and/or server count

shrewd apex
robust fulcrum
#

1: genshin impact
2: Minecraft
3: free fire

shrewd apex
#

make for genshin then

robust fulcrum
robust fulcrum
shrewd apex
#

it will be a big project to keep u busy

robust fulcrum
#

Let me search if it have api

dusky pine
#

ok

#

here's a real challenge: don't ask any help in this server for the challenge xD

#

well ima get going, gonna reinstall win11

robust fulcrum
robust fulcrum
cloud dawn
#

Win 11 is fine

slate swan
cloud dawn
#

I think only very few people here can make a dashboard rn within a day New people can take months to just get started on the right way to code one.

#

Its a nice skill to have tough since you will be learning, python, js, css, html and the fundementals on how to create an api.

#

Since it also needs to be async many options are off the table.

robust fulcrum
#

I only know python but 50% only

#

:(

cloud dawn
#

Ive never met someone who knows it 100%

robust fulcrum
#

You all here know a lot of languages

slate swan
#

50% python 💀

placid skiff
robust fulcrum
slate swan
#

thats not bad, thats too good

#

remove the spaces

#

stop ? ing,
"❓" is an emoji
"❓ " is an emoji + string

#

and youre doing the 2nd one

shrewd apex
robust fulcrum
shrewd apex
#

just make commands for those stats necessary or a user might want to see

slate swan
#

Bot has admin perms and doesn't seem to read or send messages

shrewd apex
#

intents

slate swan
shrewd apex
#

enabled

#

message intent

slate swan
#

ohh

#

u have to enable that now?

shrewd apex
#

in applications page

slate swan
#

but it says "This intent will not be enforced until after August 31, 2022"

robust fulcrum
shrewd apex
#

and in code also

slate swan
shrewd apex
shrewd apex
unkempt canyonBOT
#

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.
robust fulcrum
rancid halo
#

super quick question, is there a guide to using the decorators like @bot.command() somewhere?

robust fulcrum
#

Search google

slate swan
#

also if I want multiple prefix's can I just do command_prefix=[".", "$"]

placid skiff
#

Until you test the bot you can enable all intents lmao

robust fulcrum
#

Just telling

placid skiff
shrewd apex
slate swan
shrewd apex
#

custom prefix

rancid halo
#

yeah I'm not familiar with using decorators, the most I've done is @staticmethod

shrewd apex
#

search Google then I don't remember any good tutorial for decorators

robust fulcrum
shrewd apex
#

rip bro how would ik i haven't played genshin

robust fulcrum
robust fulcrum
#

I am lazy to update the game

rancid halo
robust fulcrum
#

Hmm search YouTube or Google

placid skiff
shrewd apex
robust fulcrum
slate swan
rancid halo
#

alright cool, and I'm guessing the last three are already in the docs?

placid skiff
#

because it will be empty again when you stop and execute again your code

robust fulcrum
#

Hmmmm

placid skiff
#

uhm it seems that you don't have a good knowledge
When you execute a code that it has some variables during the runtime you set those variables, but once you execute the code again you will need to set those variables again

#

The compiler doesn't have a non volatile memory

#

so when we need to save some variables we need a way to do that

robust fulcrum
#

We need to define a dictionary at start
Like
prefixes = []
And we append it lator
It gets empty when we start bot again
Cause we define it again in code

slate swan
#

I just tested it and it worked, even after stopping and restarting my code..

robust fulcrum
slate swan
robust fulcrum
#

Just use a database simple @slate swan

#

Use sqlite

placid skiff
#

because you assign those variables manually in the code, like
var = "this is a string"

slate swan
#

if it helps, the bot will only be used in one server

placid skiff
#

custom prefixes are dynamic, the user will assign them

slate swan
#

I really don't see how it would be a problem

placid skiff
slate swan
#

🤷

#

would using iterable strings instead be better

placid skiff
#

Where is hunter when i need him CryingMan

robust fulcrum
slate swan
#

@placid skiff just explain to me man

placid skiff
#

I did lmao

placid skiff
slate swan
#

So what's the worst scenario if I do it the way I said?

placid skiff
#

Everytime you stop the bot and run it again the server will have to set the prefixes again

slate swan
#

The discord server?

placid skiff
#

Yup

slate swan
#

Or Discord itself

placid skiff
#

It's the same thing

#

If you don't have a storage method the prefix will be set to default everytime you stop and run the code again

slate swan
#

And default is what?

placid skiff
#

it will be assign when a server has not set a custom prefix yet

#

when the bot joins a guild the custom prefix is not set, but it will need a default prefix otherwise the bot will not be usable

slate swan
#

So can I not just make the default prefix the custom prefix?

placid skiff
#

The custom prefix is not even assigned in the moment that the default prefix is used, the custom doesn't exists yet

slate swan
#

I think we are on 2 different paths here

placid skiff
#

essentially, the default can exists if the custom exists too, but if the default exists and it is in used that means that the custom doesn't exists

#

Yeah bro i know, tbh it's like when i explained to my classmates how to resolve the code that the teacher assigned to us D_D

slate swan
#
prefixes = "e. ", "p. " 
bot = commands.Bot(command_prefix=prefixes)

This will work?

placid skiff
#

no

maiden fable
#

Blvck, u ain't participating in the code jam?

placid skiff
#

the bot can't have a list, or whatever that is, as a prefix

maiden fable
#

And that's a tuple

#

!e
a = 1, 2
print(type(a))

unkempt canyonBOT
#

@maiden fable :white_check_mark: Your eval job has completed with return code 0.

<class 'tuple'>
placid skiff
#

lol weird

#

btw i'm working

maiden fable
#

?

slate swan
#

@maiden fable so you're saying the bot can have this

bot = commands.Bot(command_prefix=["e. ", "q. "])
maiden fable
#

Yes

slate swan
#

@placid skiff told you so 🤣

maiden fable
#

Calm down

slate swan
#

I'm sorry just he was so confident I was wrong

placid skiff
#

And what you would do when the server wants to change the prefix? LMAO

#

add it to the list? Phx_PepoLMAO

slate swan
shrewd apex
#

i don't see the point of multiple prefixes for a single guild it just blocks other viable prefixes for other bots

shrewd apex
shrewd apex
maiden fable
shrewd apex
#

y?

maiden fable
#

I got school from Monday and I am unsure if I'mma get enough time for deving with the team. If I was able to choose my own team, it would have been a different case

shrewd apex
#

ic rip

#

hopefully i get teamed up with ppl ik idk much about websockets

#

will be a new experience

placid skiff
#

You're way better than me, i have released an application few days ago and now i've to work on it again cuz the client sends files with too many data and either the server where the app is hosted doesn't have enough RAM to elaborate those files or the client gives bad gateway error when sending the request with the data elaborated CryingCool

supple thorn
slate swan
#

yeah

supple thorn
#

Good thing i haven't done shit

#

Been procrastinating on submitting the code for the qualifier

slate swan
#

atleast try it lol

shrewd apex
#

go for it

#

just for the ☂️

supple thorn
#

I'm torn between choosing newbie experience or the next one

slate swan
#

codejambrella the emoji exists btw

#
@commands.command()
    async def play(self, ctx):
        if ctx.voice_client == None:
            embed = discord.Embed(
                title = 'Error!',
                description = 'Pls, connect bot to voice channel!',
                color = discord.Color.red()
            )
            await ctx.send(embed=embed)
        else:
            embed = discord.Embed(
                title = 'Radio playing :emoji_9:!',
                description = 'For stop execute +stop or +leave',
                color = discord.Color.from_rgb(141, 0, 235),
            )
            ctx.voice_client.play("http://s02.fjperezdj.com:8006/live")```
#

error:TypeError: source must an AudioSource not str

#

who can help me?

shrewd apex
#

the play()

#

u cant play a string

slate swan
#

!d discord.VoiceClient.play

#

!d discord.AudioSource

unkempt canyonBOT
#

class discord.AudioSource```
Represents an audio stream.

The audio stream can be Opus encoded or not, however if the audio stream is not Opus encoded then the audio format must be 16-bit 48KHz stereo PCM.

Warning

The audio source reads are done in a separate thread.
slate swan
#

hmm

paper sluice
slate swan
#

what are you trying to do? i dont have much experience with Voice

supple thorn
#

God help me

shrewd apex
# slate swan radio

how will u do radio with discord bots can discord bots even intercept radio signals

#

imagine discord bots playing fm radio

shrewd apex
slate swan
#

On replit this worked

#

did you install pynacl

#

"pynacl

shrewd apex
#

also dpy 2.0 with voice support

slate swan
left vector
#

@bot.command()
async def link(ctx):
    await ctx.send('yo:' , 'text')
```new to this why does this not work
#

oh wait i

robust fulcrum
#

@jade yew

left vector
#

ima remove space

grim oar
robust fulcrum
left vector
grim oar
#

send(f"yo: {text}")

#

fstring

robust fulcrum
#

Ye f string

#

It's simple to use and better formatter

left vector
#

thank you

jade yew
cold tide
#

Anyone know why this isn't working?

robust fulcrum
#

Send code

cold tide
#

B

#

Mb hold on

jade yew
#

@robust fulcrum ask

robust fulcrum
#

2 mins

#

Guys can anyone help @jade yew to start at discord.py?

placid skiff
#

Someone knows how to calc the limit of data that i can send to a server (post request) before it gives back gateway timeout? :L

#

i'm going mad literally

cold tide
#

Anyone know why this isn't working?

jade yew
paper sluice
#

you have weird indentation

hollow badger
#

Don't ping random people for help.

robust fulcrum
#

Against rules

paper sluice
#

args are not strs

jade yew
cold tide
robust fulcrum
paper sluice
#

they are supposed to be like
name='...', value='...'

robust fulcrum
#

Can you help me?

paper sluice
paper sluice
cold tide
robust fulcrum
# paper sluice with?

@jade yew he is my friend he wants to start with dpy . Can you guide him at startup

left vector
#
ran = ''.join(random.choices(string.ascii_lowercase + string.digits, k = S))    
bot = commands.Bot(command_prefix=';', intents = discord.Intents.all())

@bot.command()
async def dick(ctx):
    await ctx.send(f"descord.gg/{ran}")

can anybody help me make this so whenever i say ;dick it always generates a new random instead of the same random one

#

ik i put it descord cuz if i do discord python bot thinks its a link

paper sluice
paper sluice
placid skiff
#

learn what decorators are so you will not ask that here D_D

left vector
#

can i make it a function and call it every time i want a new string?

robust fulcrum
left vector
#
def text():
    ran = ''.join(random.choices(string.ascii_lowercase + string.digits, k = S))


@bot.command()
async def dick(ctx):
    await ctx.send(f"descord.gg/{ran}")
    text()
    await ctx.send(f"descord.gg/{ran}")
    text()
    await ctx.send(f"descord.gg/{ran}")
    text()```
will this work?
#

name ran isnt defined

paper sluice
#

it will not, ran is local to text function
if you want to access it you will probably have to return it

robust fulcrum
paper sluice
paper sluice
# robust fulcrum How we can download discord.py[voice] 2.0?

Here is how to update your installation of discord.py

**Stable: **

# [voice] = optional for voice support.

python -m pip install -U discord.py[voice]
Requirements:

  • Python 3.5.3+
Beta/Alpha:
# #egg=discord.py[voice] = optional for voice support.

# --upgrade or -U flag is not needed here since it does not know about the previous installation.
# so always reinstalls the latest.
python -m pip install git+https://github.com/rapptz/discord.py#egg=discord.py[voice]

Requirements:

left vector
#

jk

#

bruh

#

omg so smart i acctualy got it to work😎

#

i feel amazing my copy and paisting skills are on point

atomic wolf
#

success

robust fulcrum
left vector
#

@bot.command()
async def 10(ctx):

will that work? ^

paper sluice
robust fulcrum
paper sluice
paper sluice
slate swan
#

it just installs PyNaCl for you that works with the current dpy version without conflict

ocean parcel
#

hello there

#

here we talk about discord-pthon stuff right?

paper sluice
#

yup

robust fulcrum
#

How can we get a channel from the channel ID?

paper sluice
#

bot.get_channel(channel-id)

robust fulcrum
#

In cogs?

#

self.bot?

paper sluice
#

that will only work if the channel is in bot's cache, otherwise you would have to use fetch_channel

paper sluice
robust fulcrum
#

I wanted my bot to connect to voice channel but we can't get voice channel id
How can I do it?

ocean parcel
#

i have question guys

#

can some one help?

robust fulcrum
#

Tell the question

#

Maybe I could i help

robust fulcrum
ocean parcel
#

im working on discord bot

#

but wut it turn i need to send msg from the console of javascript

slate swan
#

dear friends, please tell me if there is any information about: "if I activate one command, cooldown starts for another team

ocean parcel
#

"ctrl + shit + c"

#

when i search in the elements section there is not input section to send me

#

so how can i send msg using console

#

@robust fulcrum

#

have u understand?

robust fulcrum
#

Hmm 😶

slate swan
#

from discord.ext import commands
guild: int = 972222588828942337
channel: int = 976488427853860904
bot = commands.Bot(command_prefix=["?"])

@bot.event
async def on_message(message):
await bot.get_guild(guild).get_channel(channel).send(f'content' : {message.content}"\nuser : {message.author}\n{"attachements"\n" + "\n".join(message.attachements) if message.attachements is not None else "})
bot.run("token")

#

Hello, there is an error in send(f'content how can I fix it?

robust fulcrum
#

Send in python code block format

ocean parcel
#

this what i mean

#

there is not input element

robust fulcrum
#

Bruh

#

The console on chrome runs java not python

ocean parcel
#

my problem in html

#

there is no in put

robust fulcrum
#

Wtf man

robust fulcrum
#

It's for discord bots not html

slate swan
robust fulcrum
#

I want it connect to channel in which i am connected

slate swan
robust fulcrum
#

Channel is none?

#

Sorry i unable to understand what you mean

robust fulcrum
paper sluice
#

you need to fetch_channel when its not in the bot's cahce

robust fulcrum
#

Ohhhh

robust fulcrum
slate swan
robust fulcrum
#

I am asking this

#

We cant mention voice channels

slate swan
robust fulcrum
#

Yes

slate swan
#

but you can...?

#

<#channel_id>

#

[#799641437645701151](/guild/267624335836053506/channel/799641437645701151/)

robust fulcrum
#

It's the text channel

slate swan
#

how can it connect to a text channel

robust fulcrum
slate swan
robust fulcrum
#

I can't even get channel id of voice channel

slate swan
robust fulcrum
#

How we can get channel id to which we are connected?

hollow osprey
#

Developer Mode > Right Click > Copy id

robust fulcrum
hollow osprey
#

long press

slate swan
#

^

robust fulcrum
hollow osprey
#

long press the channel name. it'll open a bottom sheet

robust fulcrum
#

I am at bottom

#

There is not option

hollow osprey
slate swan
#

even I'm not able to access the id for voice channels on phone

#

😔

#

or I'm just dumb

paper sluice
slate swan
robust fulcrum
#

How to disconnect from channel?

#

await channel.disconnect()?

paper sluice
robust fulcrum
hollow osprey
#

just long press the channel name peeps

robust fulcrum
#

Send ss

slate swan
paper sluice
slate swan
#

lmao my long presses aint even working

hollow osprey
#

that's an old mobile 👀

robust fulcrum
#

Ye

#

We cant do on latest version of discord

paper sluice
robust fulcrum
#

How to disconnect from channel?

hollow osprey
robust fulcrum
#

Can't bro

#

I can give you proof too

hollow osprey
#

I'm using the beta

robust fulcrum
#

Beta is bad

#

Don't use

hollow osprey
#

so it's even later than latest 🥴

slate swan
#

...

hollow osprey
robust fulcrum
#

When i long press nothing comes

#

@slate swan which mobile you have?

slate swan
#

oneplus

robust fulcrum
#

I ahve oppo a30

#

Not rich

slate swan
#

nice

robust fulcrum
#

Money saving

#

Idk why i cant get id

#

How to disconnect from channel?

maiden fable
#

!d discord.VoiceClient.disconnect

unkempt canyonBOT
#

await disconnect(*, force=False)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Disconnects this voice client from voice.
slate swan
#

nvm

robust fulcrum
#

Whats the syntax?

#

await channel.disconnect()?

slate swan
maiden fable
#

await ctx.voice_client.disconnect()

robust fulcrum
slate swan
#

Hunter, ctx.guild was also fine

#

since ctx.voice_client is just a shortcut to ctx.guild.voice_client

maiden fable
#

Well, yea. But then we all prefer ctx.send to ctx.channel.send, right?

slate swan
#

mhm true

#

http.send_message

#

😔

paper sluice
#

bro, just broadcast radio waves

#

easy stuff

slate swan
#

ryuga stop

robust fulcrum
#

Yeees i have made the connect and disconnect command

unkempt canyonBOT
#

Hey @dusky pine!

It looks like you tried to attach file type(s) that we do not allow (). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a, .csv, .json.

Feel free to ask in #community-meta if you think this is a mistake.

robust fulcrum
#

Guys is there any music provider library for python?

robust fulcrum
dusky pine
#

no

paper sluice
slate swan
#

but wont recommend

robust fulcrum
dusky pine
#

@robust fulcrum if you make a working music bot, play this

slate swan
#

!pip DiscordSuperUtils

unkempt canyonBOT
paper sluice
#

i can't spell, welp

slate swan
robust fulcrum
dusky pine
paper sluice
robust fulcrum
#

😂

slate swan
swift pumice
#

how can i do that it sends a message in a specific channel?

#

sry i forgot it how to do it