#development

1 messages ยท Page 1151 of 1

drifting wedge
#

umm

#

wait can does everything that supports python have sqlite?

#

not heroky

dreamy cedar
#

@lusty quest like this ?

const mongoose =require("mongoose");
const {Guild} =require('../models/guild');

module.exports = async (bot, guild) => {
   const  newGuild ={
        guildID: guild.id,
        guildName: guild.name
        
    };
    const merged =Object.assign({_id: mongoose.Types.ObjectId()},newGuild)
    const createGuild = await new Guild(merged);
    createGuild.save()
    .then(result => console.log(result))
    .catch(err => console.error(err));

    console.log('I have joined a new server!');
};
slender thistle
#

SQLite is a database, so

lusty quest
#

@dreamy cedar looks good

dreamy cedar
#

@lusty quest
still the same problem
i dont get any server information in the database

faint prism
#

frick then
@drifting wedge You want a remote db. Not local

drifting wedge
#

yes

#

i tried mongo

#

byut its confusing

faint prism
#

MongoDB has a free db with Atlas

drifting wedge
#

ik

#

i got it

#

but i dont understand it

faint prism
#

I can link a video for using MongoDB in C#. But the general principles may still apply

drifting wedge
#

i mean i have a ton of my stuff in json

solemn latch
#

iirc, the docs for mongo are really good

drifting wedge
#

and in sqlite

#

is it hard to move it all to mongo?

faint prism
#

iirc, the docs for mongo are really good
@solemn latch Not for their compass client lol

solemn latch
#

compass is self explanatory isnt it?

lusty quest
#

@dreamy cedar did you get any error?

faint prism
#

I was unable to specify data types that were supposed to be available in it

dreamy cedar
#

no

faint prism
#

Docs has nothing about that issue

lusty quest
#

did you have a connection to your db?

dreamy cedar
#

yes

solemn latch
#

ah, i havent really used mongo for anything

lusty quest
#

other querys work?

solemn latch
#

only have compass because someone needed help

lusty quest
#

@faint prism some Mongodb clients doesnt allow all data types. as example mongoose doesnt allow bigint

dreamy cedar
#

i have just guildCreate

drifting wedge
#

@faint prism some Mongodb clients doesnt allow all data types. as example mongoose doesnt allow bigint
@lusty quest what do you use?

#

sorry

#

i mean woo

#

not you

#

wrong ping

lusty quest
#

currently Atlas (was running my own Cluster before but switched bcs its cheaper)

solemn latch
#

i use MySQL and Prometheus

lusty quest
#

why a Time series DB?

solemn latch
#

for time series data

lusty quest
#

so you log your Guildcount etc?

solemn latch
#

yeah, just bot stats

dreamy cedar
#

@lusty quest so any solution ?

lusty quest
#

hmm wanted to add influxdb to my bot but the docs are not that good and the querys are wired (atleast for me)

#

there is somewhere something that goes wrong

solemn latch
#

considering doing a poll command with graphing over time, was going to use a different tsdb for that.

lusty quest
#

add _id: mongoose.Types.ObjectId() to your object and remove the merged line

#

maybe this helps

dreamy cedar
#

ok ill try

lusty quest
#

does it work?

dreamy cedar
#

nope

drifting wedge
#

im watching this vid

#

how would i apply mongo to it?

#

just like instead of users.json

#

use the db?

faint prism
#

yeah

#

keep the object data in the db

#

works really well if your users.json is a collection or array of <user>

#

then if <user> has an Id, you can use that for the objectId i the mongodb

drifting wedge
#

huh?!

earnest phoenix
#

whats the variable for the voice channel name ???

quartz kindle
#

its the same for all channels

earnest phoenix
#

k thx

#

@quartz kindle lol ur a certified developer what is ur bot ?

quartz kindle
#

its called Astrobot

misty sigil
#

@oak sentinel this one

drifting wedge
#

can anyone send me an example mongo comamnd?

#

just so i can see how it works?

#

mine is giving me tons of errors

misty sigil
#

What code do you got so far

drifting wedge
#

can i send the id?

#

like the id thing

#

the url

#

or is it like a token

solemn latch
#

if its a remote ip, dont send it

misty sigil
#

no

solemn latch
#

if its just like localhost it doesnt matter

misty sigil
#

do not send

drifting wedge
#

i dont think it does

#

but i wont

#

just to be safe

#

@client.event
async def on_ready():
    print("mongo yay")

@client.command
async def test1(ctx):
    mango_url = ""
    cluster = MongoClient(mango_url)
    db = cluster["db1"]
    collection = db["prefixes"]

    ping_cm = {'command' = 1}
    collection.insert_one(ping_cm)

    await ctx.channel.send('worked')```
#

the first code is just so i see if it works

#

but its not wokring

solemn latch
#

mongodb has a free course

drifting wedge
#

im getting like INDENTATION ERROR

solemn latch
#

๐Ÿค”

#

inconsistent use of indentation

drifting wedge
#

well it loaded

earnest phoenix
#

dict values should be setted using :, like this: {'key': 'value'} not {'key' = 'value}

drifting wedge
#

is there a easier db?

solemn latch
#

most databases are pretty simple

#

you just kinda have to accept that youll need to spent an hour learning it

drifting wedge
#

its been more than an hou

#

hour

solemn latch
#

where are you learning from?

drifting wedge
#

youtube google

dreamy cedar
#

@solemn latch can you tell me whats the problem here

const mongoose =require("mongoose");
const {Guild} =require('../models/guild');

module.exports = async (bot, guild) => {
   const  newGuild ={
        guildID: guild.id,
        guildName: guild.name
        
    };
    const merged =Object.assign({_id: mongoose.Types.ObjectId()},newGuild)
    const createGuild = await new Guild(merged);
    createGuild.save()
    .then(result => console.log(result))
    .catch(err => console.error(err));

    console.log('I have joined a new server!');
};
earnest phoenix
#

../

#

what does that mean

sonic lodge
#

the parent directory

drifting wedge
#

from pymongo import Connection
connection = Connection()
connection = Connection('localhost', 27017)
db = connection.testdb
collection = db.testcollection
for post in collection.find():
print post

#

this connects it

golden condor
#

@earnest phoenix the parent of the current folder

drifting wedge
#

so would i just watch a video for example on levels

#

then just intead of json

earnest phoenix
#

p i n g f t w

drifting wedge
#

add the mono thing?

sonic lodge
#

๐Ÿ˜ฆ

solemn latch
#

why do you insist on youtube?

#

youtubes a terrible source for this

golden condor
#

@earnest phoenix sorry can you say that normally, I didn't understand

solemn latch
#

i linked to a free tutorial that even mongodb refrences

#

๐Ÿค”

dreamy cedar
#

anyone can help

earnest phoenix
#

with what

dreamy cedar
#
const mongoose =require("mongoose");
const {Guild} =require('../models/guild');

module.exports = async (bot, guild) => {
   const  newGuild ={
        guildID: guild.id,
        guildName: guild.name
        
    };
    const merged =Object.assign({_id: mongoose.Types.ObjectId()},newGuild)
    const createGuild = await new Guild(merged);
    createGuild.save()
    .then(result => console.log(result))
    .catch(err => console.error(err));

    console.log('I have joined a new server!');
};
sonic lodge
#

what's the problem

dreamy cedar
#

i didnt get any information in the database

#

when the bot join a new guild

sonic lodge
#

d.js?

dreamy cedar
#

?

sonic lodge
#

discord.js?

dreamy cedar
#

yes

sonic lodge
#

when your bot joins a guild, you need to be watching the guildCreate event

dreamy cedar
#

how i do that

opaque eagle
#

I've enabled top-level await in my TypeScript application (as you can see, broker.connect() and broker.subscribe() seem to work fine), but the for-await-of loop seems to error out. How can I fix that, or is the feature working as intended?

sonic lodge
#

somewhere in your main file

client.on('guildCreate', function(guild) {
  // insert code that adds the guild to your database
});```
dreamy cedar
#

ty
ill try

golden condor
#

@opaque eagle it's not an async function

opaque eagle
#

yeah genius, that's why I've enabled top level await

#

it's in stage 3

golden condor
#

Ok I guess I won't help if your gonna be a dick about it

opaque eagle
#

mb i didn't mean to be rude

#

anyways i fixed it now tho

earnest phoenix
#

rule 1

#

don't be a dick

golden condor
#

ok

earnest phoenix
#

follow the rules please

opaque eagle
#

typescript was compiling just fine, but webstorm (my editor) doesn't support it yet

golden condor
#

Webstorm finds everything to be wrong

opaque eagle
#

nah

#

just these cutting edge things

golden condor
#

Told me my code was wrong because I used it elsewhere lol

opaque eagle
#

that's super vague but cool

feral aspen
#

Hello

#

Does anyone know whats the problem..

#
["console", "command", "event"].forEach(x => require(`./handlers/${x}`)(bot))
^

TypeError: Cannot read property 'event' of undefined
    at Object.<anonymous> (C:\Users\hajji\OneDrive\Desktop\Attitude\index.js:6:1)
    at Module._compile (internal/modules/cjs/loader.js:1156:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10)
    at Module.load (internal/modules/cjs/loader.js:1000:32)
    at Function.Module._load (internal/modules/cjs/loader.js:899:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47```
wintry mountain
#

from pymongo import Connection
connection = Connection()
connection = Connection('localhost', 27017)
db = connection.testdb
collection = db.testcollection
for post in collection.find():
print post
@drifting wedge don't use pymongo. use motor instead

#

pymongo is blocking lib

near ether
#

is there a way to dynamically check how long my bot should wait to avoid hitting the ratelimit?

quartz kindle
#

if you're using a discord library, the library does that for you already

slender thistle
#

Isn't Motor outdated

#

or just barely functioning

quartz kindle
#

if you're working directly with discord, check the x-ratelimit headers

feral aspen
#

?

near ether
#

im using d.js but my bot still ends up getting rate limited but only once in a blue moon when i announce an event or something to my server

#

oh and tim i implemented what you told me about reaction menus

#

wait i think i told u already

#

lmfao

#

idr

wintry mountain
#

or just barely functioning
@slender thistle barely

#

so i suggest not using mongo db at all and use psql instead

quartz kindle
#

@near ether is it an actual rate limit or only the rateLimit event?

drifting wedge
#

@drifting wedge don't use pymongo. use motor instead
@wintry mountain well i got motor

slender thistle
#

catshrug I've used pymongo in my private bots and I wouldn't say it's blocking much

drifting wedge
#

?

#

im super confused

near ether
#

an actual rate limit - my bot is temp banned for an hour

drifting wedge
#

like wtf do i do?

quartz kindle
#

do you use the sharding manager?

near ether
#

yes

slender thistle
#

like wtf do i do?
@drifting wedge Try the code snippet you sent

quartz kindle
#

do you have any code that does api requests across shards?

near ether
#

theres only one which loads emojis across all shards after every one has launched, but that one is pretty lightweight and has never gotten me rate limited before

drifting wedge
#
async def test1(ctx):
    mango_url = ""
    cluster = MongoClient(mango_url)
    db = cluster["db1"]
    collection = db["prefixes"]

    ping_cm = {'command': 1}
    collection.insert_one(ping_cm)

    await ctx.channel.send('worked')``` didnt work
#

Ignoring exception in command None:
discord.ext.commands.errors.CommandNotFound: Command "test" is not found

slender thistle
#

() in the decorator

#

test1 is the command, not test

quartz kindle
#

@near ether you can try listening to the rateLimit event

#

maybe it will help

drifting wedge
#

raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: OperationFailure: bad auth Authentication failed., full error: {'ok': 0, 'errmsg': 'bad auth Authentication failed.', 'code': 8000, 'codeName': 'AtlasError'}

#

at least its talking to mongp

quartz kindle
#

although that event only fires when discord.js prevents a rate limit, not when actual rate limits happen, but it can still help to see which commands/requests are hitting the api too much

near ether
#

will it give me a stack trace to the command? or do you mean the REST/HTTP get/post stuff

quartz kindle
#

the rest stuff, including a path

queen moss
#

from a performance standpoint, is it worth it to allow normal users to have a gif profile card? For example, I have the ring around their profile changing from grayish to greenish like money in a loop - just wanted another opinion on it, since it does use a good amount of cpu power

near ether
#

when you say path do you mean the route like /channels/27829378293/etc

quartz kindle
#

yes

near ether
#

how do i know which command of mine is hitting the d.js limit?

#

most of them do the same stuff

quartz kindle
#

@queen moss should be fine if the image is cached

golden condor
#

It's not the djs limit

quartz kindle
#

but if every time you need to generate a new image, because some data changes, like a xp bar or something, then maybe its too much

golden condor
#

It's the discord rate limit

queen moss
#

yeah it generates a coin count bar, so maybe it is a bit too much

strange trout
#

I'd just make the card very customizable to make up for not supporting GIF pfp

drifting wedge
#
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: OperationFailure: bad auth Authentication failed., full error: {'ok': 0, 'errmsg': 'bad auth Authentication failed.', 'code': 8000, 'codeName': 'AtlasError'}``` wut does dis mean?
quartz kindle
#

could be a nice premium feature tho

#

animated profile cards

slender thistle
#

authentication failed apparently

queen moss
#

true, I think ill make it for people at a certain level and donors if I ever do that

drifting wedge
#

if i try again

#

would it be fifferent

slender thistle
#

Most likely not

drifting wedge
#

is it the command

#

?

quartz kindle
#

@near ether you need to find it yourself. you get for example the channel where a limit was hit, check that channel and see which commands were used in that channel

drifting wedge
#

or is it the mango connect stuff?

slender thistle
#

Make sure you are passing correct credentials to connect to the database

#

mongo connecting

quartz kindle
#

you can log commands and channels for example to find it easily

near ether
#

ahh gotcha, makes sense

drifting wedge
#

wait

near ether
#

ty!

drifting wedge
#

do i replace the password with my password?

slender thistle
#

whatever Atlas gave you as a password

drifting wedge
#

LMAO

slender thistle
#

if it's not customizable

drifting wedge
#

i am retard

#

raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: OperationFailure: bad auth Authentication failed., full error: {'ok': 0, 'errmsg': 'bad auth Authentication failed.', 'code': 8000, 'codeName': 'AtlasError'}

near ether
#

one last question, if d.js has its own ways to help stop my bot from getting rate limited (ie temp banned for an hour), how come it fails sometimes and my bot ends up getting rate limited anyways?

drifting wedge
#

it said work

#

like it worked

#

but it game me an erro

#

erorr

quartz kindle
#

it cannot track rate limits across shards

#

they are not aware of each other's rate limits

solemn latch
#

you mention it only really happens when you announce new features.
what about opening those features up slowly to people?

near ether
#

my bot has nearly 0 discord api usage across shards which is why im a little confused as to why this is the case

#

you mention it only really happens when you announce new features.
what about opening those features up slowly to people?
thats a damn good idea!

quartz kindle
#

also make sure you're not swallowing errors too much, for example dont do .catch(() => {}) and log something instead

drifting wedge
#

me?

#

i know

misty sigil
#

wdym by swallow errors tim

quartz kindle
#

catching errors and not logging them

#

so maybe there are errors happening and you dont know

misty sigil
#

i log every error to ever exist in my realm

#

even errors not in my code

opal plank
#

i throw em into the cold void

quartz kindle
#

its always a good idea to implement your own rate limiting or cooldowns

#

for example maximum amount of commands per channel per 5 seconds

misty sigil
#

i only rate limit my canvas commands

solemn latch
#

i ratelimit my ratelimits

near ether
#

i do have a per-person cooldown, also most my my reaction menu-heavy commands are limited to once every 20+ minutes

#

but yea a per-channel cooldown is a good idea

misty sigil
#

my canvas command are per server floshed

quartz kindle
#

if you have a reaction menu that can be reacted by anyone, limit the amount of reactions it can accept per 5 seconds as well

near ether
misty sigil
#

oh lmao

near ether
#

damn honestly i didnt even think of that

#

there is no limit to how often you can react

quartz kindle
#

imagine you have 20 people reacting at once

near ether
delicate shore
#

hey guys

exotic pond
#

is there a obligation writing form in englisch ?

earnest phoenix
#

yep

lyric mountain
#

I guess so

earnest phoenix
slender thistle
#

I'm questioning making post_server_count return the posted stats in a dictionary to the developer (dblpy) ๐Ÿค”

#

5/20s

#

5 presence changes per 20 seconds

regal jacinth
#

@slender thistle i pinged u to tell u that it finally worked
now my bot is connected to the website and i can do the dashboard stuff
thank u ^^

slender thistle
#

Ey you figured out the most part of it though, I just gave you the preferred way of accomplishing what you wanted ๐Ÿ˜‚

regal jacinth
#

ik but that actually helped alot me cuz i didn't know how to start

#

XD

slender thistle
restive furnace
#

How much is the limit to a auto-changing status.
but do it wisely, please. like around 30 secs per change

midnight blaze
#

You see the section "TITEL"? Is here anyone a pro with fs? I dont want to load the name with fs, which is under the section:"NAME"
Anyone an idea how to get the information from TITEL and save it into an array?

quartz kindle
#

that informetion is stored inside the file

midnight blaze
#

yes, the thing is, how to get that information tho

#

there must be a way ๐Ÿค”

quartz kindle
#

there is no easy way to do it with fs, you'd need to know the structure of the file to be able to extract it from there

#

but there are many npm libs that can do that for you

midnight blaze
#

ok, I got it, I thought I ask before I go and search for other libs

#

oh

#

thanks man

indigo flax
#

How to make a changing status (all playing) for discord.js ^12.2.0

restive willow
#

How to read the docs

indigo flax
#

where is docs @restive willow

restive willow
#

I believe you can find them on https://www.google.com

indigo flax
#

i searched no answer @restive willow

earnest phoenix
#

what is the variable for message author channel id ?

quartz kindle
#

message.author.dmChannel gives you the channel

indigo flax
#

wdym @earnest phoenix

quartz kindle
#

but it might not exist

#

if it doesnt exist you need to create it

#

await message.author.createDM()

earnest phoenix
#

i mean guild channel

#

voice channel*

quartz kindle
#

message.member.voice.channel

earnest phoenix
quartz kindle
#

yes

earnest phoenix
#

k thx

midnight blaze
earnest phoenix
#

Tim I need your opinion, and possibly some help, what do youthink is better for caching prefixes, redis or an lru cache?

quartz kindle
#

@midnight blaze if for some reason the voice channel is not cached or doesnt exist

#

@earnest phoenix i'd cache them in memory

#

if you have guilds cached, you can even attach it to the guild object

earnest phoenix
#

Just plain out no lru?

quartz kindle
#

yeah

earnest phoenix
#

hm, alrighty.

#

I need something that works well due to the fact that it will be getting accessed a LOT

slender thistle
#

What does "lru" happen to be?

quartz kindle
#

in-memory is the best way

earnest phoenix
#

least recently used

slender thistle
#

oh

quartz kindle
#

you can make a quick lru thing yourself, but its not really needed

#

unless you're an optimization freak

#

prefixes are literally a couple bytes of ram lol

glossy elk
#

oi

#

does anyone know

#

where i can get fAPI

quartz kindle
#

what's that?

indigo flax
#

<client>.user.setActivity('<activity>'); <--- does that work for discord.js 12.2.0

glossy elk
#

yes

misty sigil
#

yes

glossy elk
#

what's that?
@quartz kindle its like i dont know but there is a thing called fapi

#

and some people use it

quartz kindle
#

well what does it do?

#

lmao

indigo flax
#

<client>.user.setActivity('<activity>'); or client.user.setActivity('<activity>');

glossy elk
#

like image generation or website screenshots

#

um

#

<client> is your client

#

if <client> = client then both of them are correct

quartz kindle
#

no idea what that is then

#

pretty sure its not "financial-grade API"

pure lion
#

How to config ts compiler so it can handle async :^)

lone coyote
#

ok thank you

glossy elk
#

how do i add shards

misty sigil
#

you forgot the : after on_ready

#

didn't you?

slender thistle
#

I almost got triggered there because of a missing colon

lone coyote
#

how do i check for mentions in discord py?

slender thistle
#

message.mentions exists

#

Depends on which mentions exactly you need though

lone coyote
#

im pretty sure it errored me

pure lion
#

How to config ts compiler so it can handle async :^)
cOfF

lone coyote
#

but i can try again

glossy elk
#

how do i add shards

pure lion
#

Shard manager

#

How many guilds does dum have?

glossy elk
#

.a

pure lion
#

Jaja dotpost

glossy elk
#

what

#

hehe

lone coyote
#

huh it worked this time. thank you!

slender thistle
#

Magic

lone coyote
#

yup

fierce arch
#

Hello I am having a problem with custom emojis in messages. They are spitting out like this and not showing the actual emoji. :outage: Only the bot owner can use these commands Im using discord.py

misty sigil
#

Is the bot in the same server as the emoji?
What are you using for the emoji? (what is your emoji string thing)

pure lion
#

Why is my ts compiler giving me !async and not async

lone coyote
#

now i tried it a different way as it is the way that would work much better, but it gives me typerror can only concatenate str not list to str with this code: if message.content.startswith('*'): if message.content.startswith('*tip ' + message.mentions): await message.channel.send('BLAH')

#

im dumb sorry

fierce arch
#

Is the bot in the same server as the emoji?
What are you using for the emoji? (what is your emoji string thing)
@misty sigil Yes bot is in same server this is the string !outage

misty sigil
#

Ok

#

So, your custom emoji is isn't in the correct format

#

Do you mind sending the emoji here so I can make it the correct format?

fierce arch
#

Im trying to send it formatted correctly but discord says no

misty sigil
#

Can you send the emoji here?

fierce arch
#

tehre

misty sigil
#

:outage:

#

it should work

#

theoretically

fierce arch
#

With no ID?

misty sigil
#

No.

#

Does the bot have external emoji perms?

fierce arch
#

So <:outage:> or :outage:

glossy elk
misty sigil
#

<:outage:ID>

earnest phoenix
#

@glossy elk how many servers ur bot in ?

#

u should add shard when ur bot in 1000+ servers

fierce arch
#

@misty sigil Thats what I have been trying

misty sigil
#

no idea then ngl

#

should work

glossy elk
#

not the point

lone coyote
#

message.mentions is giving me a type error that it can concatenate only str and not a list

misty sigil
#

message.mentions returns a list then

lone coyote
#

im only mentioning myself

#

like @lone coyote

misty sigil
#

still returns a list

lone coyote
#

hmm

#

ok

#

ill try to fix that then

#

thanks

misty sigil
#

in js we just message.mentions.users.first()

#

but im sure py is different

#

i'll give it a shot acc brb

lone coyote
#

i am trying just join the list to make a string

#

darn it didnt work

slate ravine
#

Does anyone know a bot that can give Multiple roles to someone from a command?

#

[Not A Reaction role, A Command that gives the member roles]

slender thistle
#

now i tried it a different way as it is the way that would work much better, but it gives me typerror can only concatenate str not list to str with this code: if message.content.startswith('*'): if message.content.startswith('*tip ' + message.mentions): await message.channel.send('BLAH')
There's a way to get around this @lone coyote

#

What exactly do you want to do?

hasty fog
#

ะŸะพะผะพะณะธั‚ะต, ะบัƒะดะฐ ั ะฒะพะพะฑั‰ะต ะฟะพะฟะฐะป? ะœะฝะต ััั‹ะปะบัƒ ะบะธะฝัƒะปะธ ะธ ั ั‚ัƒั‚. ะฃ ะฒะฐั ั‚ัƒั‚ ั€ัƒััะบะธะน ะบะฐะฝะฐะป ะตัั‚ัŒ?

lone coyote
#

i want my bot to check for * in an if statement, then if it starts with *, then check for *tip + a mention

slender thistle
#

ะ ะตะบะพะผะตะฝะดัƒัŽ ะฟะพั‡ะธั‚ะฐั‚ัŒ #502193464054644737 ั ัะฐะผะพะณะพ ะฝะฐั‡ะฐะปะฐ, ะตัะปะธ ะฒะพะทะฝะธะบะปะธ ะบะฐะบะธะต-ั‚ะพ ะฒะพะฟั€ะพัั‹

lone coyote
#

you can speak russian? nice. I can hardly read it, but can speak it much better, but anyway, back to my bot

slender thistle
#

i want my bot to check for * in an if statement, then if it starts with *, then check for *tip + a mention
@lone coyote Then something like this

if message.content.startswith('*'):
        if message.content.startswith('*tip ') and message.mentions:
            await message.channel.send('BLAH')
#

this would check if message started with *tip and included at least one mention

lone coyote
#

i would do that, but i want it to be explicitly *tip followed by at least one mention not *tip blah blah blah mention if possible

slender thistle
#

ehhhh

#

one more nested if? ๐Ÿ˜‚

lone coyote
#

haha sure

#

but how?

slender thistle
#
        if message.content.startswith('*tip '):
            if len(message.mentions) > 0:
                await message.channel.send('BLAH')
#

there's also this option

silent pagoda
#

I think you need to create a role reaction if you want the bot to assign more than one role @slate ravine

solemn latch
#

thats not true

lone coyote
#

alrighty ill try the options

#

thank you for the help ofc

silent pagoda
#

Why

slender thistle
#

I don't think it can get any more explicit than that

solemn latch
#

!giveroles Role1 Role2
gives two roles

slender thistle
#

unless you go fuck-all and create a custom function if_message_starts_with_arg_and_has_mentions

solemn latch
#

or any number of roles

lone coyote
#

well maybe i should?

slender thistle
#

๐Ÿ˜‚

#

Don't know, it's up to you

lone coyote
#

haha ill try

slender thistle
#

Could just slap a comment between both of those ifs also

lone coyote
#

what do you mean by that?

slender thistle
#
        # message starts with prefix
        if message.content.startswith('*tip '):
            # message contains a mention
            if len(message.mentions) > 0:
                # everything passed, time to get working
                await message.channel.send('BLAH')
lone coyote
#

i thought it would somehow change what the code would do so i was confused. Sorry about that

#

makes sense

slender thistle
lone coyote
#

thank you

slender thistle
lone coyote
#

how would i gok about creating a custom function? (I am seriously staring to think I have bitten off more than I can chew)

#

i think i know what you mean

#

but im not certain

slender thistle
#

Well

lone coyote
#

im sorry that I keep asking more and more questions, but I am truly grateful that you keep responding

slender thistle
#
def check_mentions_and_message(message: discord.Message):
    # some of your other stuff here possibly
    # etc etc
    if message.content.startswith('*tip '):
        if len(message.mentions) > 0:
            return await message.channel.send('BLAH')
    return None

@client.event
async def on_message(message: discord.Message):
    result = check_mentions_and_message(message)
    if result is None:
        # message not sent
    else:
        # message was sent
#

Something like this basically

#

You can play around with it catshrug

#

Hmm, you could also probably return a tuple with a custom response

lone coyote
#

this i knew, but could i somehow check if the mention was ight after *tip?

#

right*

slender thistle
#

Well, there's the option of going the regex way...

#

or calculating character positions manually

#

Do you want only one mention to be allowed?

#

Oh, do you think you could utilize d.py's commands extension?

lone coyote
#

if message[5] = @?

#

idk

#

one mention is ok

#

but more would be better i guess, buti am becoming a hassle i feel like

slender thistle
#

Hmm

#

Do you accept something like a reason after the mention?

lone coyote
#

what do you mean by that?

#

im a big noob, and this is my biggest project

#

or at least it will be bu the end

slender thistle
#

*tip @mention catch this you poor noob

lone coyote
#

by*

#

i would accept a number

slender thistle
#

Where catch this you poor nob is the "reason" or some sort of a "message" to the mentioned person

lone coyote
#

because it is a crypto tipping bot

slender thistle
#

Oh oops, forgot about a number

lone coyote
#

haha no worries

slender thistle
#

Give me a second to try something

lone coyote
#

sure sure

quartz kindle
#

*tip 999 @user9 thank you or *tip @user9 999 thank you?

lone coyote
#

number 2 if possible if thats what you are asking

slender thistle
#

Actually, do you think you would like to accept usernames and IDs as user input for the member?

quartz kindle
#

split on spaces, use regex to match the id

#

then join the message

slender thistle
#

use string indexes to get the mention

lone coyote
#

like string[5] must be @?

quartz kindle
#

no, dont do that

#

split on spaces and operate on words instead of characters

earnest phoenix
#

How do I delete a file using eval?

lone coyote
#

oh ok

earnest phoenix
#

Ping me

slender thistle
#

I'm thinking of suggesting you discord.py's commands extension

@commands.command()
async def tip(ctx, member: discord.Member, amount: int, reason: str):
    await ctx.send("BLAH")```
lone coyote
#

i'll try that

quartz kindle
#

so for example you get an array of words like ["*tip","<@user>","999","message","words","here"]

lone coyote
#

yes

quartz kindle
#

then you can check if array[1] matches a valid id by using regex and extracting the numbers from it

slender thistle
#

We're kind of going two ways here and I don't want to confuse you anymore. I shall take my leave for now ๐Ÿ˜‚

quartz kindle
#

lol sorry

lone coyote
#

thank you for being so helpful

drifting wedge
#

mongodb works with heroku?

slender thistle
#

nah Tim it's fine, I'm only suggesting the half-assed way because d.py's cmds extension simplifies most of the stuff

drifting wedge
#

not well

#

just does it work

slender thistle
#

not if you host it on the Heroku machine

earnest phoenix
#
 client.on('voiceStateUpdate', (oldState, newState) => {
})```
How can i get here the channel id for newState ?
drifting wedge
#

ofc

#

ok

#

cool

#

@slender thistle u dev?

slender thistle
#

newState should have a channel property, shouldn't it?

drifting wedge
#

or just help out testing bots?

slender thistle
#

Both

drifting wedge
#

cuz u dont have dev badge

#

o ok

slender thistle
#

Continue this topic in #general if you want

earnest phoenix
#

how do i get it

drifting wedge
#

sowwy

pure lion
#

@earnest phoenix get your bot to 76 servers + submit passport/ID

earnest phoenix
#

hm ?

slender thistle
quartz kindle
#

oldState and newState are VoiceState objects

#

VoiceState objects contain a channel property

earnest phoenix
#

How do I delete a file using eval?

quartz kindle
#

so VoiceState.channel

slender thistle
#

There's a separate channelID property also

quartz kindle
#

aka newState.channel

pure lion
#

How do I delete a file using eval?
Like a file on your machine?

earnest phoenix
#

Yee

#

Through eval

quartz kindle
#

fs.unlink

pure lion
#

Y tho

earnest phoenix
#

Cause

#

I wann

lone coyote
#

it doesnt work because at least in my version of discord py, it uses client.event() and it says it's missing some argument

earnest phoenix
#

@pure lion its for my ticket system

quartz kindle
#

you can delete files using fs.unlink

earnest phoenix
#

ok

slender thistle
#

Is there any particular reason it's named that and not something like remove like os.remove in Python?

earnest phoenix
#

so require(fs).unlink("./helpall.js")

#

?

quartz kindle
#

because thats how the linux function is called

slender thistle
#

Oh

earnest phoenix
#

@quartz kindle so require(fs).unlink("./helpall.js")?

quartz kindle
#

windows also uses unlink actually

earnest phoenix
#

Look at the eval part

quartz kindle
earnest phoenix
#

Ok

quartz kindle
#

your way works if you use unlinkSync

lone coyote
#

when i tried commands.command() it didnt work as my discord py vers uses client.event(), but changing commands.command to client.event made it say that it was missing an argument

slender thistle
#

Oh yeah

earnest phoenix
#

require("fs").unlinkSync("./helpall.js")

slender thistle
#

You'll have to do the following

from discord.ext import commands

# I suggest renaming this variable to `bot` to avoid any confusion in the future
client = commands.Bot(command_prefix="*")
# if you want to remove d.py's default help command
# client.remove_command("help")

@client.event
async def on_message(message):
    # my stuff
    await client.process_commands(message)

@client.command()
async def tip(...):
    # ...
#

Since await client.process_commands(message) is responsible for actually making commands.Bot work with the commands

lone coyote
#

ok do i need to pip install discord.ext?

slender thistle
#

Nah

lone coyote
#

oh ok

merry grove
#

Why is it when i run my bot on VSC the enmap settings save but once i deploy on heroku the settings disapear and reset to default

earnest phoenix
#

heroku doesn't update files realtime

quartz kindle
#

heroku uses an ephemeral file system

#

files are not stored permanently

merry grove
#

oh

earnest phoenix
#

Tim big brain

solemn latch
#

new word of the day

earnest phoenix
#

ikr

quartz kindle
#

you can read more here

merry grove
#

Thanks

solemn latch
#

so tim, how did you get so good about helping people with their random issues?
just a lot of time on stackoverflow/support communities?

quartz kindle
#

being good at googling and getting the gist of the issues lul

solemn latch
#

๐Ÿค”

lone coyote
#

still missing an argument shivaco

#

missing coro

slender thistle
#

huh?

#

which part?

lone coyote
#

TypeError: event() missing 1 required positional argument: 'coro'

slender thistle
#

Send your full code please

lone coyote
#

hold on i may have fixed it

#

testing

#

didnt work so here is my code:

#
from discord.ext import commands

client = commands.Bot(command_prefix="*")

@client.event
async def on_ready():
    print('We have logged in as {0.user}'.format(client))

@client.event
async def on_message(message):
    if message.author == client.user:
        return

    if message.content.startswith('*'):
        if message.content.startswith('*tip ') and message.mentions:
            await client.process_commands('test')

@client.event()
async def tip(ctx, member: discord.Member, amount: float, reason: str):
    await ctx.send("BLAH")

client.run('MY TOKEN')```
#

idk how to keep the syntactical highlighting

slender thistle
#

oh

#

not .event for d.py commands

#

it's @client.command()

solemn latch
#

```py
```

lone coyote
#

oh ok

#

so i change both to command?

slender thistle
#

just the part where you create a function tip

lone coyote
#

ok thanks

#

can i get an explanation why if you are in the mood?

#

still didnt work

#

this error now: File "C:\Users\Sam\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py", line 312, in _run_event await coro(*args, **kwargs) File "c:/Users/Sam/Soycoin Bot.py", line 17, in on_message await client.process_commands('test') File "C:\Users\Sam\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\bot.py", line 936, in process_commands if message.author.bot: AttributeError: 'str' object has no attribute 'author'

slender thistle
#

why-

#

oh

#

yeah give me a second

lone coyote
#

of course

slender thistle
#

basically what d.py does with the decorator is add it to some sort of dictionary that is used internally

What await client.process_commands(message) does is it gets the message content, creates a Context object for it, and then parses everything according to your command's function parameters (In tip, you have the parameters member, amount, reason which d.py will try to place correctly as well as convert if there's type annotations)

#

You are supposed to pass a message object to process_commands, not a string

lone coyote
#

that might be my problem

#

testing again

slender thistle
#

yeah

#

'test'.author won't work so

#

:^)

lone coyote
#

exactly

#

i misunderstood the reason for it

#

it didnt error me, but didnt say BLAH

#

what input parameters should i try?

slender thistle
#

*tip 571120962138013708 0.1 test

lone coyote
#

alrighty

#

doesnt work

#

also pinging myself like @lone coyote doesnt work :(

slender thistle
#

oh wait

#

Change your on_message to

@client.event
async def on_message(message):
    if message.author == client.user:
        return

    await client.process_commands(message)
#

fuck

lone coyote
#

?

#

i changed test to message

slender thistle
#

there

#

try that

lone coyote
#

ok

#

IT WORKS!!!!!!!

#

thank you

slender thistle
#

ey nice

lone coyote
#

thank so much

#

you are very helpful

slender thistle
#

I suggest reading a bit on d.py commands extension on their official docs for more info

lone coyote
#

anyway, i gtg eat, but seriously THANK YOU

#

will do

slender thistle
lone coyote
#

bye

pure lion
#

hoo ping me

golden condor
#

@pure lion

glossy elk
#
      message.channel.fetchMessage(msg.id)
#

fetch message is not a function in v12?

summer torrent
#

messages.fetch

glossy elk
#

cache.fetch?

#

k

sonic lodge
#

no, messages.fetch

pure lion
#

@glossy elk das v11

glossy elk
#

k

pure lion
#

how 2 sort mongoose documents by -1 and then get the first docc?

#

(ik all the things except from sort and finding from that sort)

cosmic robin
#

I'm making a custom embed bot and I've made the embed, but I'm wondering how I turn the command into variables to use

solemn latch
#

ive never used an embed bot.
what do you want the argument structure to look like?

glossy elk
#
   message.channel.overwritePermissions(message.guild.id, {
                    SEND_MESSAGES: false
                })```
#

Uncaught Promise Error: TypeError [INVALID_TYPE]: Supplied overwrites is not an Array or Collection of Permission Overwrites.

cosmic robin
#

so i want the command to read -embed '...' '...' '...' '...' and change whats in the ' to variables

digital ibex
#

error is self explanatory

#

second parameter isnt an object

#

use split, phil

#

how 2 sort mongoose documents by -1 and then get the first docc?
@Full Stack Dice#2213 -1?

pure lion
#

idk

#

i want to get smol numnum first

solemn latch
#

like sort by value?

pure lion
#

yeah

solemn latch
#

.sort()

pure lion
#

sort() of?

digital ibex
#

hes talkign about mongo queries

solemn latch
#

like
find().sort(whatever your sorting by)

digital ibex
#

its not an array

pure lion
#

h m

solemn latch
#

?

pure lion
#

ooooooo ty

solemn latch
#

isnt .find a query

pure lion
#

okay cant be too bad

#

just get [0] of the results

digital ibex
#

oh not js sort i never knew that was a thing

#

i thought u could use keys but idk

pure lion
#

okay so i want to sort by a field of the name "timestamp"

#

idk what to take from docc

slender thistle
#

find().sort({timestamp: 1})

earnest phoenix
#

How can i check in discord js if 2 guild members aare in the same voice channel ?

dusty onyx
#

as a sorta hypothetical, how would you test code that involves getting votes from people? would you only be able to test it once a day or is there something you can do?

pure lion
#

find().sort({timestamp: 1})
tank

cosmic robin
quartz kindle
#

@dusty onyx there is a test button for testing the vote webhook

dusty onyx
#

oh nice

earnest phoenix
#

i can run a file python with js?

misty sigil
#

what

earnest phoenix
#

no

digital ibex
#

u talking about compiling python or smthing?

earnest phoenix
#

i mean, like:

//in js:
!runfile file.py
quartz kindle
#

you can use child_process.exec

digital ibex
#

with or without runtime?

quartz kindle
#

exec lets you run a command in your terminal, the same way you would run any other terminal command

earnest phoenix
#

oh, ok

pure lion
#
await Bot.find().sort({ timestamp: 1 })[0].inviteLink
```dis gud?
misty sigil
#

yes probably

digital ibex
#

i dont think it returns an array but idk, try it

#

iโ€™d use the gte key thingy cuz its just simpler imo

pure lion
#

also

#
'https://ale-bot.xyz/bots?id=test'
```this is my url , i want to parse it and get the value of ID
#

but all im getting is id=test

digital ibex
pure lion
#

ah

cosmic robin
pure lion
#

might i need to parse?

digital ibex
#

youโ€™ve defined args, use args

#

do u just want it to return โ€˜testโ€™, dice?

earnest phoenix
#

How do i check if 2 guild members are on voice connected in the same channel ??

amber fractal
#

compare their voice channel id

pure lion
#

do u just want it to return โ€˜testโ€™, dice?
its going to be a dynamic url ting that queries if the param is there

#

i could substring 3

#

fuck it ill do that

digital ibex
#

u dont need to

#

if its id=t u want it to return t? if its id=gg u want it to return gg?

#

if so

pure lion
#

yeah

digital ibex
pure lion
#

but

#

undefined

digital ibex
#

show ur code

pure lion
#
console.log(req.params)```
digital ibex
#

show the full endpoint

pure lion
#

isnt that all thats necessary

digital ibex
#

no

earnest phoenix
#

how i can put a "watching" activity in py?

digital ibex
#

just remove any other things, so like just show
app.get(...., {
console.log(req.params)
})

pure lion
#

nvm it works for some reason

dry zephyr
#

Yo

torn ravine
#

can you use emojis in footers?

dry zephyr
digital ibex
#

nope, fits

dry zephyr
#

Can I talk to someone high up?

digital ibex
#

wut

earnest phoenix
#

what

dry zephyr
solemn latch
#

the github iirc

dry zephyr
#

Whereโ€™s that

#

Iโ€™m new to all this

solemn latch
earnest phoenix
#

bruh

dry zephyr
#

Thanks

slender thistle
#

how i can put a "watching" activity in py?
@earnest phoenix bot.change_presence method where you pass a discord.Activity for the activity kwarg

#

the discord.Activity instance must be instantiated with name and type=discord.ActivityType.watching kwargs

#

Shortly speaking, you would get something as big as bot.change_presence(activity=discord.Activity(name="you", type=discord.ActivityType.watching))

earnest phoenix
#

thx

#

does anyone know any super good vps hosts?

fleet mason
#

hetzner

thick gull
#

check pins

earnest phoenix
#

@thick gull didnt even know that was there thanks bud

fleet mason
#

i just have to say. Using OVH was a pain ^ (its in the "suggested services")

solemn latch
#

super good?
id go with some big name like google or digital ocean

earnest phoenix
#

am i stupid or what is it classed as on digital ocean

solemn latch
#

vps?

earnest phoenix
#
 if(message.member.voice.channel.id !== chanel.channel.id){
return message.channel.send(`Trebuie sa va aflati pe acelasi canal de voice.`)

}```
#

is this good ?

solemn latch
#

hard to say

earnest phoenix
#

user.user

summer torrent
#

what

earnest phoenix
#

wot

#

damn no offense but how are u a dev

#

and your github is called davidproscripter

#

i am new in node js

midnight blaze
#

@earnest phoenix oof

pure lion
#

and your github is called davidproscripter
Peg

midnight blaze
#

@earnest phoenix what is your main language then, if it is not node.js?

grizzled isle
#

Hey all, if i did something like "blagg".substring(3), it should return "gg", right?

amber fractal
placid iron
pure lion
#

@grizzled isle you could literally try this in your browser

#

@placid iron you should be! Very well done :3

grizzled isle
#

Okay. Thanks for the phenomenal help.

placid iron
#

@pure lion thank you my G axoheart

amber fractal
#

open any decent browser. Press ctrl shift i. paste the code you showed us

pure lion
#

Np g :D

placid iron
#

ok and back to toradora! XD

torn ravine
#

I want to make my prefix command available only to me and those who have the "Manage Server" permission. I tried using || and &&

honest perch
#

The code snippet for the permission?

torn ravine
#

specifically
if (message.author.id !== "my id" || message.member.hasPermission(`Manage Server`)

pale vessel
#

use && and the permission value is MANAGE_GUILD

honest perch
#

But isn't && and

torn ravine
#

it is and

#

also I use manage guild

pale vessel
#

shouldn't there be ! before the member permission check?

solemn latch
#

doing things from memory

pale vessel
#

that code is for return, right?

torn ravine
pale vessel
#

don't think so

torn ravine
#

I'll try it

earnest phoenix
#

why

logModel.findOneAndUpdate({ id: message.guild.id }, { $set: { log: 'canalID' } }, { new: true }).log 

dont work?

pale vessel
#

if the author ISN'T you AND the person has no permission, return

if one of those condition is true, it won't return

torn ravine
#

use && or ||

pale vessel
#

&&, AND

drifting wedge
#

any1 help with mongodb? atlas

#

?

sinful belfry
#

-ask2ask

gilded plankBOT
#

Don't ask to ask.
Just ask your question, it wastes time if you say "i need help" or "can someone help me?" instead of just saying what the problem is. Save your time and other people's time and just ask the question.

Please read https://dontasktoask.com/ for an explanation on why this is an issue.

drifting wedge
#

me is having issues with mongo db atlas

#

no errors

#

ping me pls

pale vessel
#

just

solemn latch
#

no errors, no issues. KEKW

pure lion
#

What is the issue tho

drifting wedge
#

no errors

#

it doesnt log it to atlas

pure lion
#

"Guys help! My bot is giving no errors!"
"Does it work?"
"Yes but I'm still sure there's a problem"

sinful belfry
#

yeah, what isn't happening that should be happening or vice-versa

drifting wedge
#

like i can saend code

sinful belfry
#

and yeah send ur code too

pure lion
#

Are you:
Connecting
Saving

sinful belfry
#

that helps people

drifting wedge
#

can i send long code:

#

or hastebin:

pure lion
#

Bin

solemn latch
#

hastebin as usual

pure lion
#

Use my bot

solemn latch
#

you have a bin bot?

pure lion
#

aa!bin does stuff

drifting wedge
#

hpw?

#

aa!bom

pure lion
#

Testing 1

drifting wedge
#

how?

honest perch
#

Or just paste it into hastebin

#

Would be faster

drifting wedge
#

?

ionic dawn
#

rip python

quartz kindle
#

your mongo url is the full url including username and password right?

#

did you whitelist your ip address?

grizzled isle
#

@torn ravine you wanna use || for what your saying. Youd wanna check if the author is your id OR if the member has Manage Server.

amber fractal
#

well they're using !== id right

torn ravine
#

issue fixed

amber fractal
#

also ^

#

old mmLol

torn ravine
#

I tried &&

#

but what I didn't realize was that I was using the commands on the incorrect bot

drifting wedge
#

is aws good?

#

like as a db?

#

and id aws good as a host?

#

and how behind r u guys on apps?

sinful belfry
#

and how behind r u guys on apps?
@drifting wedge bot approval?

sick cloud
#

dumb css question: how do i center a div vertically

drifting wedge
#

yes

sinful belfry
#

yes
@drifting wedge wrong channel to ask, but the last bot to be approved was submitted ~28 days ago

solemn latch
#

just passed 4 weeks queue time recently iirc

placid iron
#

@sick cloud not a dumb question at all

drifting wedge
#

lol

placid iron
solemn latch
#

youve asked about pretty much every host ๐Ÿค”

placid iron
#
  <div></div>
</div>```
#

flexbox to the rescue

#

as always

drifting wedge
#

youve asked about pretty much every host ๐Ÿค”
@solemn latch well i talked to my parents

#

and they said theyd be happy to pay for google or aws

sick cloud
#

that just breaks it

drifting wedge
#

whichone would you sue?

#

use*

#

lmao

sick cloud
solemn latch
#

i highly recommend digital ocean or galaxy gate

drifting wedge
#

well which one of the 2? @solemn latch

sick cloud
#

digital ocean all the way

solemn latch
#

digital ocean is a bit more expensive but more well known

placid iron
#

center it then

sick cloud
#

what

solemn latch
#

galaxygate is a smaller company but cheaper

drifting wedge
#

now its squished to one side of the page
@sick cloud use this thing called mobrise

#

its really good

sick cloud
#

what

placid iron
#
<div style="display:flex;justify-content:center;align-items:center;">
  <div></div>
</div>```
drifting wedge
#

i made this with it

#

its really good and ez to use\

sick cloud
#

i'm trying to vertically centre a div

#

how will a website builder help me

placid iron
#

yes but then you complain about not centering it horizontally

drifting wedge
#

well you can make a website

#

so you dont have to code it lol]

placid iron
#

that code i just sent does that too i think

sick cloud
#

then how do i build the back end

#

@placid iron still breaks it all

drifting wedge
#

wdym

#

you can like add pages and that stuff

#

backend as in a dashboard?

ionic dawn
#

Hi, I have a question, im trying to send an image using a link that has no "format at the url", when I use the message.channel.send({file: [['URL']}) it sends a file but isnt an image, is there a way to change the file format when sending it?, hopefully my eng isnt that bad and you guys understand what im saying lolok

placid iron
#

idk, just learn flexboxes and you will be happy ยฏ_(ใƒ„)_/ยฏ

solemn latch
#

backend as in backend

sick cloud
#

stop suggesting i use a drag and drop shit thing when all i need is some css to style an existing, fully complete prototype

drifting wedge
#

which one is better, aws or google?

sick cloud
#

@placid iron this is without nay other code, the container is the right length and all

#

but i want to centre it vertically

solemn latch
#

both are huge and massively used

placid iron
#

uh

#

set the width then

drifting wedge
#

for discord bot?

#

does it not matter?

solemn latch
#

for all server stuff

earnest phoenix
sick cloud
solemn latch
#

they sell by the hour iirc rather than monthly

sick cloud
#

how does width help with vertically centering

#

wouldnt it be height

drifting wedge
#

there is the free thing

ionic dawn
#

flex center

earnest phoenix
#

google flexbox centering

ionic dawn
#

flex center + grid

#

my question get ignored hard, F

placid iron
#

@earnest phoenix i tried to say that

earnest phoenix
#

Can someone help me please w my code?

placid iron
#
.container {
  display: flex;
  justify-content:center;
  align-items:center;
}

.toCenter {
  width: fit-content;
}```
i assume you get this from this http://howtocenterincss.com/#contentType=div&horizontal=center&vertical=middle&browser.IE=none
sick cloud
#

flexbox doesnt mix well with bootstrap

sinful belfry
#

@ionic dawn try doing .send({files: ['url']}); instead

ionic dawn
#

thats how im doing it

earnest phoenix
#

what's the url

sinful belfry
#

that's not what you put in ur original message

ionic dawn
#

ill check if I can render the link or somethin to get the actuall image

sinful belfry
#

you're just doing 'file' rather than 'files'

ionic dawn
sinful belfry
#

ah ok

#

tried that?

ionic dawn
#

just miss that S

#

yeh, but the file dnst have an extension

#

so discord dont load any image

#

just sends a raw file

sinful belfry
#

do you know what the extension will be?

ionic dawn
#

whatever img extension works to render the image at discord

#

ill try somethin

earnest phoenix
#

it needs to be a valid extension matching the file header

#

otherwise the rendering will fail

#

you can't present a jpg as a png

ionic dawn
#

Okay, I figured a way to do it

#

Web scrapping is the key for all

torn ravine
#

is anyone elseโ€™s bots 401ing at some events

faint prism
#

no

summer torrent
#

how can I use await in template literal

torn ravine
#

just memmulu

dire obsidian
#

Give me a stupid command idea

lone coyote
#

for whatever reason, my code always says Unknown Recipient with a valid recipient, and also gives me the same error i have in except for an invalid one. code is: @client.command() async def tip(ctx, member: discord.Member, amount: float, reason: str): try: await ctx.send(str(message.author) + " tipped " + str(member) + " " + str(amount) + " for " + reason) except discord.ext.commands.errors.BadArgument: await ctx.send("Unknown Recipient")

placid iron
#

Can you even use ctx with client, don't you have to use Bot

#

Also I would advise looking up f strings

lone coyote
#

it worked before i tried to break it

#

i know about f strings, but i am not advanced enough to understand them too well. Ehh i guess i'll go do that

placid iron
#

Oooo

#

Message.Author

#

See a problem?

lone coyote
#

no?

placid iron
#

Where does message come from then

fading hedge
lone coyote
#

here's the full code:

solemn latch
#

looks kinda overpriced ๐Ÿค”

lone coyote
#
from discord.ext import commands

client = commands.Bot(command_prefix="*")

@client.event
async def on_ready():
    print('We have logged in as {0.user}'.format(client))

@client.event
async def on_message(message):
    if message.author == client.user:
        return

    await client.process_commands(message)

@client.command()
async def tip(ctx, member: discord.Member, amount: float, reason: str):
    try:
        await ctx.send(str(message.author) + " tipped " + str(member) + " " + str(amount) + " for " + reason)
    except discord.ext.commands.errors.BadArgument:
        await ctx.send("Unknown Recipient")
client.run('MY TOKEN')```
fading hedge
#

1 dollar

#

Overpriced?

solemn latch
#

150mb of ram tho

#

๐Ÿค”

#

no real specs or what you actually get

placid iron
#

@lone coyote yeah you have to think about message.author still

lone coyote
#

so how would you recommend i do it? i am a big noob after all ๐Ÿ˜„

placid iron
#

Where does message come from

#

You just use message but it's not created anywhere in that function

lone coyote
#

yes it is

placid iron
#

No

lone coyote
#

async def on_message(message)

placid iron
#

I'm talking about the tip function

earnest phoenix
#

What host is that? @solemn latch

placid iron
#

ctx.author would work

lone coyote
#

oh ok

earnest phoenix
#

Yeah, figures

#

A site with "discordbots" in the name, as a hosting provider

solemn latch
#

their "buy now" button doesnt work

#

lol

placid iron
#

@lone coyote I think you should try to learn some more of the basics of python before venturing deeper into discord bots

solemn latch
#

how can you trust a host whos website doesnt error properly even

#

lmao

earnest phoenix
lone coyote
#

14rovi, i agree with you, but i really do want to try this one bot

placid iron
#

I mean, nothing is stopping you

solemn latch
#

he seems to be a reseller actually

lone coyote
#

it is a real place though

solemn latch
#

someone just buying from another company and reselling the servers for more money

#

or well. selling less resources for the same amount

#

probably buying 1 euro servers and reselling 10 of them for $1 each

earnest phoenix
#

Porbably

#

Probably*

placid iron
#

Damn

solemn latch
#

well, the site errored and linked to fragbytehosting

placid iron
#

Good marketing strategy lmao

solemn latch
#

googling it lead to these guys

#

so ๐Ÿคทโ€โ™‚๏ธ

earnest phoenix
#

Jfc

solemn latch
#

actually dead

#

i cant believe people buy this stuff

placid iron
#

People visit the first link not knowing any context

earnest phoenix
#

You get what you pay for

lone coyote
solemn latch
#

honestly, buying a nice vps with a few cores and a few gigs of ram.
probably could start up some containers and provide bot hosting for people who need small bot hosting.

placid iron
#

Have a read

lone coyote
#

sure

placid iron
#

Your answer is in there I know

earnest phoenix
#

Okay so let me get this straight @solemn latch