#development

1 messages ยท Page 354 of 1

quasi marsh
#

Requests is blocking

uncut slate
#

why do you want a blocking request

#

also that looks like js

#

you can make an async callback-based request return sync though

fervent goblet
#

no thats javascript

#

thats hte thing

#

with react state I can semi remove the callback part

#

I just need to return the result in a function

#

so I need blocking

#

then I am sure the callback has been called (setting the state) when the function returns

thorny hinge
#

What would be the best to save a player's score (website game)

fervent goblet
#

client or server side?

thorny hinge
#

Server side

fervent goblet
#

just a plain score, number?

#

do u have a user id?

#

you could use redis

#

players:<ID>:score

earnest phoenix
#

Suh

#

@thorny hinge get a mongodb instance running and store object to a collection OR write json files containing and object with all players stats

inner jewel
#

no

#

just no

#

json files are a horrible way to save data

earnest phoenix
#

Yea but

inner jewel
#

corrupts easily, won't work concurrently

earnest phoenix
#

Its easier

#

I recommend mongodb

#

But if he has no experience

inner jewel
#

shooting yourself in the head is also easy, but that doesn't mean it's a good thing to do

earnest phoenix
#

Json would be a quicker easier solution

icy lynx
#

I'm with Natan on this one

#

There are other non-sql that don't store as json

earnest phoenix
#

Im not saying its better just two options he has

inner jewel
#

rethink stores as json

earnest phoenix
#

Mongo is bae

#

Not a fan of rethink

wise nexus
#

hate and love json files

inner jewel
#

i hate json files for data, love for configs

icy lynx
#

Cassandra is nosql and doesnt store as json afaik (correct me if wrong)

wise nexus
#

^^^ love it for configs

inner jewel
#

redis can store json too

earnest phoenix
#

Json is litterally just for settings

inner jewel
#

as strings

icy lynx
#

Redis and json makes sense imo, since it's meant for caching

earnest phoenix
#

I havent ever touched redis

inner jewel
#

i've been using redis as my main way to save data for months now

#

never had issues

earnest phoenix
#

I just do good ole mongodb for all my projects

quasi marsh
#

@inner jewel I'm doing it too and my migration seems to have been flawlessl

#

To the point where I'm considering a lot more useful applications for my bot

earnest phoenix
#

Is redis something yall would highly recommend me lookin into?

quasi marsh
#

Yeah

icy lynx
#

I use Redis for caching only

quasi marsh
#

Although SQL is definitely a useful skill

inner jewel
#

it's not very good at storing complex data but as a cache/simple kv storage it's awesome

quasi marsh
#

And for big bots you might want a more redundant database

icy lynx
#

It's good if you use it right

earnest phoenix
#

Is it just strings?

#

Or objects

inner jewel
#

technically binary data

#

but usually you'd save strings

icy lynx
#

Music queues -> redis(ram)
Level system -> maria/mongo/etc

inner jewel
#

there's hashes (basically key->key->value), lists, sets, sorted sets

earnest phoenix
#

Oh

icy lynx
#

I think of redis as "if server crashes, it doesn't matter that i lose everything on redis"

inner jewel
#

on mine i'd lose at most 1h of data

#

if it crashes

earnest phoenix
#

It is a temp cache,

#

?

inner jewel
#

you can have it saving to disk

icy lynx
#

I use it as temp cache

inner jewel
#

if you enable persistency

#

you can have TTL on keys too

earnest phoenix
#

๐Ÿค” intresting ill check it out once home from worj

inner jewel
#

the docs are really good

earnest phoenix
#

Yea for learning any library ect i litterally just look at docs and an example on github

#

People underestimate docs

icy lynx
#

Sometimes it's the docs or weird issues that confuses us

#

I once was following the docs and couldn't get it running

#

Turns out it was outdated, and they didnt care to update

earnest phoenix
#

Rip

icy lynx
#

๐Ÿ˜…๐Ÿ—ก

earnest phoenix
#

Out of date docs are pretty much worst then no docs

icy lynx
#

Ya

earnest phoenix
#

Because u think your doing it right because docs say so then u find out your code is fucked

icy lynx
#

When something doesnt work, I also check their repo issues section. I can't be the only one, hopefully

earnest phoenix
#

Lol

#

Gotta run peace

icy lynx
#

๐Ÿ‘Œ

quasi marsh
#

@icy lynx I look in the docs for the simplest of things

#

Like model attribute etc

lethal sun
#

If you want your bot to send animated emojis follow these steps:

  1. Add an animated emoji to a server where your bot is. Basically add a .gif file as an emoji.

  2. Paste this code where you want your emoji to be:

<a:emoji_name:emoji_id>```

3. Replace `emoji_name` with the name of your animated emoji. Caps-Lock is sensitive.

4. Replace `emoji_id` with the id of your animated emoji. To get the id you type in a `\` then your animated emoji name. Example: \:pingball:

**Note**: Please note that the `a` is needed. Without it animated emoji will not be displayed. Both regular and Nitro users can use this code and add them to a server.
inner jewel
#

if you don't have nitro that doesn't work

#

you need to eval the id

wooden shoal
#

somebody send the wumpus imma test

lethal sun
#

@inner jewel use snipping tool. adjust the time to like 1 second. then click new then send :emoji_name: then snipping tool should capture the id before discord edits it to just :emoji_id:.

#

but be fast

fervent goblet
#

Huh? I saw some talking about redis

#

someone said its great for kv storage

#

I definitely agree with that

scenic crest
#

redis is great for object storage too

#

but table like storage is tricky

fervent goblet
#

yeah

#

thats why I use mongo in combination with redis

quasi marsh
#

I wouldn't have two NoSQL together

fervent goblet
#

why

quasi marsh
#

I'd rather use Redis with something like PostgreSQL

fervent goblet
#

how so

quasi marsh
#

Redis, Mongo and other NoSQL databases have a tendency to use in-memory databases

scenic crest
#

in my experience you don't even need an SQL

fervent goblet
#

same array

scenic crest
#

I do everything w/ Redis

#

working fine

fervent goblet
#

I hate sql

scenic crest
#

but persistance is rip

fervent goblet
#

I don't store everything in Redis

quasi marsh
#

Me too

fervent goblet
#

its about 50/50 mongo/redis

quasi marsh
#

I might look into Rethink

fervent goblet
#

both critical parts of projects

quasi marsh
#

I think that one does immediate writes

scenic crest
#

rethonk*

fervent goblet
#

if mongo goes down my bot is fucked

scenic crest
#

depends what you need it for

fervent goblet
#

if redis goes down my bot is fucked

#

rethonk

#

yeah I have considered looking into it

#

but I am waiting till my new pc

inner jewel
#

rethonk has a lot in memory too

#

here it uses a few GB of ram

fervent goblet
#

thats 64bit, rethonk doesnt' support 32bit win

#

cuz this is a crappy fucking pc

quasi marsh
#

Your PC doesn't support 64bit?

#

What is this 2004?

inner jewel
#

i've been using only redis for months, zero data loss

fervent goblet
#

ikr aux

#

its a shitty pc I'm using cuz my craptop broke

quasi marsh
#

๐Ÿ˜ฆ

#

I just migrated over to Redis

#

FROM CONFIGPARSER

inner jewel
#

data.json feels

quasi marsh
#

"Auxim, why didn't you think configparser was a bad idea"

#

"Refuse to comment"

fervent goblet
#

no what the fuck aux

#

u don't store config settings in redis

inner jewel
#

i almost saved data in json files in my bot

#

for testing

fervent goblet
#

store the redis url in redis

inner jewel
#

because embedded-redis can be a bitch some times

fervent goblet
#

thats actually a great idea, lets store the redis url in redis, then we can grab it from the config stored in redis

#

L O L AUX

quasi marsh
#

I switched to redis because it lags SCP clients

#

Not because it didn't work

#

And kv storage is perfect for my current usecase

fervent goblet
#

So

#
f = bot.shards[guild.shard_id]._client
#

if I do f.guilds

#

does it only give you the guilds that shard is on or all guilds?

wise nexus
#

no

#

f.Guilds.Size

fervent goblet
wise nexus
#

oh nvm

fervent goblet
#

tf

#

@quasi marsh

quasi marsh
#

I just use client = discord.AutoShardedClient()

#

Check da docs

fervent goblet
#

same

#

but I want to know the amount of guilds of the current shard

wise nexus
#

the docs should tell you

fervent goblet
#

so I can display that in stats

#

actually I think I got a better way

#

well

#

easier

quasi marsh
#

What I do atm, but I dont' require sharding yet, is just post total guild count only for shard 0

fervent goblet
#

thats not what its about

#

I want to display shard specific stats in p!about

quasi marsh
#

I don't know

#

Since I don't care about those stats I haven't looked into them

#

Read the docs

fervent goblet
#

ah wahtever

#

I'm gonna store all guidls in mongo anyway

#

I'll put shard_id in the db

#

then I can just find all guilds with the same shard id as the current guild

#

and display that

wise nexus
#

thats an ugly way, tbh

inner jewel
#

why not just id

#

and filter with the formula

#

shard_id = (guild_id >> 22) % shard_count

fervent goblet
#

I want to find the amount of guilds on the shard

inner jewel
#

guilds.filter(thing=>(thing.id >> 22) % shard_count == this_shard_id).count()

fervent goblet
#

if I want to get the guilds shard id I can just use guild.shard_id

#

thats js

#

or

inner jewel
#

or smth like that

fervent goblet
#

java

#

or whatever lang

#

I'm using python

inner jewel
#

same concept

fervent goblet
#

but you are right

#

discord.utils.get

#

I totally friggen forgot

#

thanks

fervent goblet
#

like

#

p!exec git pull

#

that would return the result

#

and send it pagified

thorny hinge
#

parseFloat("2.33").toFixed(2) + parseFloat("2.33").toFixed(2) gives 2.332.33

#

Not 4.66

earnest phoenix
#

I'm trying to make a thing that will pull values from url to craft ogp tags

#

not working

#

here's my code

#
<?php
        echo '<html prefix="og: http://ogp.me/ns#">';
        echo '<meta property="og:title" content="' . htmlspecialchars($_GET["name"]) . '" />';
?>```
#

any ideas?

#

doesn't work

cerulean zinc
#

rip

#

Ive never understood ?param stuff

#

never seemed to work for me either

fervent goblet
#

fuck php

earnest phoenix
#

still nothing, tried adding another thing

abstract mango
#

<meta property="og:title" content="blah" />

earnest phoenix
#

I see no difference from what you just posted to my code

thorny hinge
#

Anyone know how 2 make a nice progress bar, with uh liquid animation in it? Actually, I could probably just use css and jQuery Thonk

earnest phoenix
#

kek

#

nope

next bluff
#

bootstrap does that pretty nicely

#

but that might be overkill if you don't need it for anything else

icy lynx
#

You can just take the bootstrap css you need

#

I have been starting using bootstrap-grid, which is the only thing I care about

earnest phoenix
#

sup bruvs

earnest phoenix
#

lmao no why

earnest phoenix
#

Can I get some help.

wise nexus
#
var nice = new DiscordEmbedBuilder()
                {
                    Title = $"{ctx.Member.Username}: Here are Yone\'s stats.",
                    Color = new DiscordColor(0xBA68C8),
                    Fields = {} //<---- how do I use this
                };```
earnest phoenix
#

ok so like

#

fields is an array of objects

#

the objects have a name and a value

#

like

#

fields = [{
name: "",
value: ""
}]

#

idk about discord embed builder but thats standard discord api for embeds

wise nexus
#

I figured it out

quiet bobcat
#

How can I make so if there isn't a server dispatcher it just returns instead of crashing? Using discord.js and this is the error ```js
if (server.dispatcher) {
^

TypeError: Cannot read property 'dispatcher' of undefined```

glossy sand
#

if (!server) return;

quiet bobcat
#

ah

#

Thanks

glossy sand
#

checks if server is false-y

#

i.e. undefined or null in this case

quiet bobcat
#

Yeah

#

Thanks that worked!

quiet bobcat
#

I'm trying to react to a message with ๐Ÿ‘ and ๐Ÿ‘Ž but when I use the command it says js (node:3700) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): DiscordAPIError: Unknown Emoji I'm using discord.js and here's the code js message.react(":thumbsup:"); message.react(":thumbsdown:");

delicate zephyr
#

Use +1

#

:+1:

#

๐Ÿ‘Ž

#

And -1

quiet bobcat
#

What?

#

so message.react("๐Ÿ‘" + 1)?

thorny hinge
#

No

quiet bobcat
#

I don't understand

thorny hinge
#

You have to use the unicode

#

The unicode for the +1 thing

#

๐Ÿ˜ฎ -> ๐Ÿ˜ฎ

quiet bobcat
#

so message.react("+1F44D")

#

?

thorny hinge
#

If that's the unicode ๐Ÿ‘€

quiet bobcat
#

ok

thorny hinge
#

๐Ÿ‘

#

Actually that would be the better option ^

#

message.react("๐Ÿ‘")

#

With the unicode

quiet bobcat
#

But how do I make it put the reactions on the message that the bot sent?

#

bc right now it puts reactions on the command message

lethal sun
#

i use this option:

mesaage.react('\๐Ÿ‘');```
thorny hinge
#

async/await

const idk = await message.channel.send("hello");
idk.react("๐Ÿ‘");

resolving it with .then()

message.channel.send("Hello").then(m => m.react("๐Ÿ‘"));
#

@quiet bobcat

quiet bobcat
#

Yes

thorny hinge
#

I would use the async/await

quiet bobcat
#

When I use await I always get unexpected identifier on message

#

any way to fix that?

#

and btw I'm trying to react with 2 emojis

thorny hinge
#

Then you'll just do it twice ofc

#

Another .then()

#

Or another idk.react()

quiet bobcat
#

But it just reacts one

thorny hinge
#

Im telling you how to react with 2

#

And lemme see your message event

quiet bobcat
#
        message.channel.send(embed).then(message => message.react("๐Ÿ‘")).then(message => message.react("๐Ÿ‘Ž"));```
thorny hinge
#

Yeah

#

But can I see your message event?

#

I might know why you can't use async/await

quiet bobcat
#

Like this? bot.on("message", function(message)

#

is that the message event?

thorny hinge
#

That's the beginning

#

Is that what you have?

quiet bobcat
#

yes

thorny hinge
#

Switch to this:

bot.on("message", async message => {
#

And when you do your message handling, the end will be });

quiet bobcat
#

yeah

thorny hinge
#

So in conclusion

bot.on("message", async message => {
//code goes here
});
#

And then you'll be able to use await

#

Which is way cleaner than .then()

quiet bobcat
#

Ok

#

Yaay

#

it works now

thorny hinge
quiet bobcat
#

I can use async

#

And now it reacts twice

#

๐Ÿ˜ƒ

lethal sun
#

gg

quiet bobcat
#

thanks atmg

thorny hinge
#

No problem

earnest phoenix
#

Got a question, I'm new to atom

#

And so I don't know how to open python

#

to check errors and to run

#

the thing

lethal sun
#

mm

wise nexus
#
DSharpPlus.Exceptions.UnauthorizedException: Unauthorized: 403
``` ```csharp
public async Task Ban(CommandContext ctx, DiscordMember mem, int days, [RemainingText] string reason = "")
        {
            try
            {
                await mem.SendMessageAsync($"You have been banned from {ctx.Guild.Name}\nReason: {reason}");
                await ctx.Guild.BanMemberAsync(mem, days, reason);
                await ctx.RespondAsync(
                    $"{mem} has been banned with the reason, {reason}, Deleted {days} worth of messages");
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }``` Lib: `DSharpPlus`
earnest phoenix
#

Help?

wise nexus
#

youtube

thorny hinge
#

@wise nexus no perms to ban?

wise nexus
#

i have perms

thorny hinge
#

Hm

#

Then idk why it would cause a 403

wise nexus
#

let try something brb

earnest phoenix
#

Hera

#

How do you run thing on Atom

#

run some sort of code

wise nexus
#

you type

#

and have python installed

#

and run the script with the python program

earnest phoenix
#

Alright

earnest phoenix
#

Hey, so I was told earlier today about the cached users. Someone, I think it was space ๐ŸŒน in the official discord.js server said "Do a forloop of every guild and then add to a variable".

I've tried all morning to do this, no success. Does anyone have any help?

young cradle
#

users

#

for loop of every guild

#

Are you sure he said that?

#

Actually, what do you want to achieve to be exactly

wooden shoal
#

are you trying to addd every user to an array?

earnest phoenix
#

I'm trying to stop this thing when I reset my bot I lose 2k users.

#

restart*

wooden shoal
#

what do you mean? How are you caching them?

earnest phoenix
wooden shoal
#

so... are you trying to get a number for every user?

earnest phoenix
#

Yes.

wooden shoal
#

oh ok

#

and what lib?

fervent goblet
#

?

#

djs

wooden shoal
#

oh ya i am stupid lol

#
let x  = 0;

let y = bot.guilds.map(g => g.members.size);

for(i=0;i<y.length;i++) {
    x+=y[i];
}
``` In this case, x would be he user count.
#

@earnest phoenix

thorny hinge
#

Not exactly accurate though

#

What if the same person is on multiple guilds

wooden shoal
#

um

#

it will count them twice ya I see ur point...

wooden shoal
#

welp I found a simpler way and now I feel fucking stupid

#
bot.users.size
young cradle
#

Oh i see what you mean

#

@earnest phoenix every user that is cached can stays there even if you do not share server with him, that user will only be uncached when you do not share any server on the next reboot, meaning <Client>.users is almost never accurate on the amount of users

#

I would be scared without that info like you were, 12-20k users "disappear" every reboot

earnest phoenix
#

Rawr

#

lol

ornate shadow
#

again I'm bumping into some async problems...

#
let embed = new Discord.RichEmbed()
    .setColor(`#006633`)
    .setTitle(`${result[0].name}`)
    .setDescription(`${result[0].name}'s stats.`)
    .addField(`Race`, `${result[0].race}`, true)
    .addField(`Gender`, `${result[0].sex}`, true)
    .addField(`Location`, await characterLocation(con, message), true);

await message.channel.send({embed: embed});
#

I can't manage to wait for the function characterLocation(con, message) to compute and return a value, therefore it returns undefined...

#

can anyone help me, please?

oak imp
#

Why not store it as a variable, then create an embed using said variable.

ornate shadow
#

I tried that aswell

oak imp
#

Try.Then.Catch

inner jewel
#

characterLocation is probably returning undefined

#

ยฏ_(ใƒ„)_/ยฏ

oak imp
#

Use an if check in the variable.

inner jewel
#

try debugging that function

ornate shadow
#

I know it works because I tried console.log(characterLocation(con, message)); and it returns what's intended to return.

inner jewel
#

await x() != x()

#

try removing the await

ornate shadow
#

                let location = characterLocation(con, message);
                let embed = new Discord.RichEmbed()
                    .setColor(`#006633`)
                    .setTitle(`${result[0].name}`)
                    .setDescription(`${result[0].name}'s stats.`)
                    .addField(`Race`, `${result[0].race}`, true)
                    .addField(`Gender`, `${result[0].sex}`, true)
                    .addField(`Location`, location, true);

                message.channel.send({embed: embed});
#

still undefined

#

tried with or without async/await at message.channel.send and at characterLocation()

unique star
#

what even does your function do

#

await only works if it has a promise

ornate shadow
#

returns the character location

#

i.e Starting Zone [0, 0]

unique star
#

does it just rawly return that

#

or in a promise?

ornate shadow
#

it returns that as a string

unique star
#

then you dont need to await it

#

and your error is something else

ornate shadow
#
function characterLocation(con, message) {
    con.query(`SELECT name, x, y FROM characters WHERE user_id = '${message.author.id}' AND online = 1`, (err, character) => {
        if(err) throw err;

        if(character[0]) {
            con.query(`SELECT * FROM zones`, (err, zones) => {
                if(err) throw err;

                if(zones[0]) {
                    let zoneDistances = [];
                    for(let i = 0; i < zones.length; i++) {
                        let zoneDistance = Math.sqrt(Math.pow(zones[i].x, 2) + Math.pow(zones[i].y, 2));
                        zoneDistances[i] = {name:zones[i].name, distance:zoneDistance};
                    }

                    zoneDistances.sort(function(a, b) { // SORT ZONES BY DISTANCE
                        return a.distance-b.distance;
                    });
                    let tempString = `${zoneDistances[0].name} [${character[0].x}, ${character[0].y}].`;
                    console.log(tempString);
                     return tempString;
                } else message.reply(`no zones were found in the database.`);
            });
        } else message.reply(`you are not logged in on any of your characters.`);
    });
}
#

this is the function

#

it does return a string both in and out of the function

#

ยฏ_(ใƒ„)_/ยฏ

#

if I console.log it

inner jewel
#

you never return anything there tho

ornate shadow
#

oh so there might be an error and not getting past the if

#

ok, thanks! I will look into that

thorny hinge
#
function idk(interval, duration){
alert("oof");
setInterval(idk, interval);
}

How can I clear this interval after some period of time

tawny lava
#

add a setTImeout

ornate shadow
#

@inner jewel I'm so dumb... xD I managed to fix my function

#

thank you!

glossy sand
#

is there a meaningful way to verify that the owner of a bot does, indeed, own the bot?

fervent goblet
#

Without it's token, no

lethal sun
#

mm

fervent goblet
#

discord should add more api functions

glossy sand
#

love too, discord api

fervent goblet
#

for example /users/<id>/profile for bots

#

/oauth/apps/<id>

#

with info such as owner

#

bot id

#

rich presence crap maybeh

glossy sand
#

I guess I can just add a report button and ipban people who register bots that aren't theirs

fervent goblet
#

what are you making?

#

a bot list?

elder rapids
#

My question is why getting application info is restricted behind an authorization

#

Shouldn't that info be public?

glossy sand
#

not a bot list

#

a different sort of service

fervent goblet
#

well novus

glossy sand
#

it's a secret

fervent goblet
#

its not that easy

elder rapids
#

sure it is ๐Ÿ‘€

fervent goblet
#

Phanta can ya tell me in dm? I'll keep it private

glossy sand
#

nah

fervent goblet
#

I can help dev

glossy sand
#

nah

fervent goblet
#

TELLME

#

I wanna reconstruct your face

#

with an object oftenly used constructing a house or smth

#

aka I want to throw a brick at your face

glossy sand
#

๐Ÿ‡ณ ๐Ÿ‡ฆ ๐Ÿ‡ญ

fervent goblet
#

Yo does anyone here know react well?

#

I need oauth in react

low niche
#

not me

fervent goblet
#

for once smth isn't a dick

#

oauth2

#

has GET callback

#

s

low niche
#

@glossy sand what was that passport thing that you made?

fervent goblet
#

code as ?code=lolnofuckyouthisisaninvalidcodeforanyoauthapplicationwhateveryouwant

glossy sand
#

not for react is what it is

low niche
#

I don't want it for react tho

glossy sand
#

unless you want to use my extremely unstable and probably-not-ready-for-production webapp lib, you don't need it

low niche
#

oh it has to use floof

#

RIP

prime cliff
#

ur a floof

low niche
#

So I am Phanta's ExpressJS replacement?

thorny hinge
#

Making a dashboard for my bot.
No clue where to start.

prime cliff
#

Easy store all passwords and tokens in plain text files

glossy sand
#

is there some way to get information about a bot from discord api

#

without a bot account, that is

prime cliff
#

@glossy sand Thonk

#

No not really

#

But most bot listing sites already have apis for that

#

Thats enough for me

glossy sand
#

I don't want my service to depend on dbl lol

prime cliff
#

๐Ÿ˜‰

elder rapids
#

Discord Bot Hub

glossy sand
#

is 192 bits of entropy enough for an api token lol

earnest phoenix
#

Am i able to make my bot change its game every couple of minutes? In JavaScript if so... how?

glossy sand
#

absolutely not

#

the rate limit will stop you

earnest phoenix
#

Ow

#

Not even each 2 mins it changes?

quiet bobcat
#

I've seen bots that do that though?

earnest phoenix
#

Same

quiet bobcat
#

That I know are using js

#

But its like every 10 or 20 mins

glossy sand
#

the limit is 2 times per hour

quiet bobcat
#

30 mins then

earnest phoenix
#

Oh

#

Nvm lol

#

Actually yeah fine, how would i do it then

glossy sand
#

but I mean if you're abusing it for some reason, the discorders will still ban you

earnest phoenix
#

You know how to do it?

glossy sand
#

discord.js?

earnest phoenix
#

Correct

glossy sand
quiet bobcat
#

He said game lol

#

not username

glossy sand
#

wtf

#

I read name

earnest phoenix
#

Ik how to set the bots game but idk how to loop it every 30mins

glossy sand
#

I'm blind sorry

earnest phoenix
#

Lol np

glossy sand
#

I don't remember the rate limit for setting games, but it's definitely not 2x per hour lol

earnest phoenix
#

Oh lol

glossy sand
#

what you can do is use a setInterval to run a function intermittently

earnest phoenix
#

Okay lol cheers bud, do i use it in the same way as setTimeout? Woth the time in milliseconds

glossy sand
#

yes

#

so like setInterval(func, 1000) would run func every second

earnest phoenix
#

Okay

#

Thanks and Merry Christmas ๐ŸŽ…๐ŸŽ…๐Ÿ˜๐Ÿ‘Œ๐ŸŽ‰

elder rapids
#

game ratelimit is 5 times every 60 seconds

#

Or something around there

#

I think I update mine every 15 seconds and that's just enough to not ratelimit

earnest phoenix
#

Mk

elder rapids
#

bad idea if you ratelimit your game change though lol

#

Discord kicks you off the websocket

earnest phoenix
#

Im setting it so it changes rvery minute

elder rapids
#

That's plenty enough to not ratelimit then

#

Don't ever worry about hitting it

earnest phoenix
#

Lol yeah

elder rapids
#

The ratelimit resets every minute or so iirc

earnest phoenix
#

Lol okay good

elder rapids
#

So once per minute definitely won't do anything bad

reef thorn
#

e

uncut slate
#

why are regexes so fucked :(

const source = `
Core 0:       +67.0ยฐC  (high = +80.0ยฐC, crit = +100.0ยฐC)
Core 1:       +69.0ยฐC  (high = +80.0ยฐC, crit = +100.0ยฐC)
Core 2:       +67.0ยฐC  (high = +80.0ยฐC, crit = +100.0ยฐC)
Core 3:       +67.0ยฐC  (high = +80.0ยฐC, crit = +100.0ยฐC)
`;

const rx = /Core \d:\s+\+(\d+)/g;
console.log(source.match(rx))

this returns

[ 'Core 0:       +67',
  'Core 1:       +69',
  'Core 2:       +67',
  'Core 3:       +67' ]
#

I clearly have a seperate capture group for the temp, around the second \d

earnest phoenix
#

xD

#

gl

uncut slate
#

for anyone who cares

#

/(?<=Core \d:\s*\+)\d+/ works

#

positive lookbehinds, but it's not on LTS

quiet bobcat
#

Can someone help me? I'm trying to get the duration of a song. I'm jusing discord.js youtube-info ffmpeg get-youtube-id simple-youtube-api and ytdl-core. (probobarly not even using half of these). If I need I can download new modules to make it happen.

thorny hinge
#

MadThinker maybe the npm docs for those modules have something for duration?

quiet bobcat
#

That could work

earnest phoenix
#

@quiet bobcat duration of the whole song or the duration it has already played

quiet bobcat
#

The whole song

earnest phoenix
#

oh well nvm

neon pasture
#

So I want to use a custom emoji from my server :pepe:394859125240234005 But instead of the emoji, it just shows :pepe:

plucky gale
#

@neon pasture d.js?

neon pasture
#

eris

plucky gale
#

o idk

neon pasture
#

how do you do it for d.js then?

plucky gale
#

d.js it's message.client.guilds.get(emojiServer).emojis.find('name', 'pepe')

#

i think

neon pasture
#

But I want that you can use it on every server.

plucky gale
#

you can

#

@neon pasture

  App.emotes = {}
  
  config.emoteservers.forEach(es => {
    let guild = Bot.guilds.get(es)
    guild.emojis.forEach(emote => {
      App.emotes[emote.name] = emote
    })
  })```
#
await message.author.send(this.emotes['xoxo_info'] + ' Add me to your server with this link: ' + ilink)```
mighty barn
#

shouldn't it be like `:pepe:?

#

ah nvm nvm

neon pasture
#

no it's like :pepe: and then the id

mighty barn
#

like add <>

quiet bobcat
#

I think it's <:pepe:idgoeshere>

neon pasture
#

I did

mighty barn
#

hm

neon pasture
#

But it wouldn't show in this message then xd

quiet bobcat
#

Are you sure it's the right id?

mighty barn
#

ye right forgot about that cd

neon pasture
#

Yes the id is right

plucky gale
#

@neon pasture just use what i posted

#

it's the correct thing

languid dragon
#

is it an animated emote @neon pasture EYES

neon pasture
#

nope

#

that one is it.

languid dragon
#

the only reason i could imagine why it wont work

#

is that its not in the same guild

neon pasture
#

It is.

languid dragon
#

well

plucky gale
#

c'mon m9

languid dragon
#

is it in an embed?

#

that may cause it

plucky gale
#

I already answered

inner jewel
#

does the bot have external emojis permission?

neon pasture
#

it is in a embed

plucky gale
#

that too

neon pasture
#

Let me check that

plucky gale
#

permission matters

#

never do anything without consent

#

no means no

neon pasture
#

It has admin perms

#

and external emojis permission.

languid dragon
neon pasture
#

Never mind then :(

#

I will use that stupid ๐Ÿธ emoji then :( ewwww

plucky gale
#

๐Ÿ˜ข

quiet bobcat
plucky gale
#

๐ŸŒˆ

shut wave
#

Someone knows how can I do a message that edits every seconds and make a countdown ?

umbral pelican
#

mmm rate limits

thorny hinge
#

^

#

What lib? @shut wave

shut wave
#

js

thorny hinge
#

Lib

#

Not lang

shut wave
#

oops

#

soz

#

node

thorny hinge
#

That's not a lib

umbral pelican
thorny hinge
#

Lol

#

Eris, discord.js?

umbral pelican
#

lib = library

thorny hinge
umbral pelican
#

it's gonna be d.js

thorny hinge
#

Could be eris

shut wave
#

wait

#

discord.js

thorny hinge
#

Alrighty

umbral pelican
#

-bots @shut wave noembed

gilded plankBOT
#

๐Ÿ• unbelievable ๐Ÿ•#9038's certifieddev bots:
@limber sphinx certifiedbot @steep horizon

umbral pelican
#

Luca pls

#

-bots Hasuko noembed

gilded plankBOT
#

Hasuko#2043's bots:
@inland mist

tawny lava
#

lol what

#

nice double space

umbral pelican
#

Mobile problems

thorny hinge
#
function functionName(msg, msg2){
message.channel.send(msg).then(m => m.edit(msg2));
}

Theres also another way:

async function functionName(msg, msg2){
const a = await message.channel.send(msg);
a.edit(msg2);
}
#

Writing code on mobileโ„ข

umbral pelican
thorny hinge
#

ur gonna have to setTimeout

#

The function

#

10 times

#

Idk actually

#

If that would work

#

Probably won't

#

๐Ÿ‘€

shut wave
#

i'll see

thorny hinge
#

setTimeout(functionName, 1000)

#

For 1 sec

shut wave
#

Ok I finally got it

thorny hinge
#

It worked? @shut wave I wouldn't think it would

shut wave
#

I used what you give me with other things, ye

plucky gale
#

sup

shrewd field
#

If I have a bot that is for 3 weeks offline will get out of the list and kicked from the server

young cradle
#

Kicked, no. But your role can be revoked depending how long it's off, you should be really worried if you were Certified, as you're not, i guess there's no problem

ornate shadow
#

what do you guys think about Golang?

#

C++ was and is my main language and I heard that Go is pretty much C++ on speed xD

#

what are your thoughts?

inner jewel
#

worst part about go imo are gc pauses

#

but it's good for concurrent applications

#

channels and goroutines make concurrnecy really easy to do

trim steppe
#

@shrewd field no need to worry, your bot has already been deleted

thorny hinge
earnest phoenix
#

-bots @shrewd field

gilded plankBOT
#

This user has no bots

earnest phoenix
craggy ginkgo
#

I did npm i discordbots-api in the right folder, it's right where all of the other modules are, but my bot still says it can't find it. :/

#

Strange

trim steppe
thorny hinge
#

Any other thing won't work

#

Doing a bash one when using js wont work

#

Doing a js one when doing python wont work

#

Get your facts right and stop using literally if it's not literal!1!1!! lol

#

Thank you for your time

trim steppe
#

Literally was used as a hyperbolic description by many English writers - it is only today with people like you that scream about the use of the word "literally". You're literally wrong here.

#

Pretty sure Shakespeare used it

plucky gale
#

btw, I'm looking for someone that has experience with discord.js to give me some feedback on a project of mine

drowsy yarrow
#

me

marsh sable
#

equally lmfao

plucky gale
abstract mango
#

use discord.js-package

#

it may get people confused, if you use discord-package

#

( I mean, there's 4 libs for js )

craggy ginkgo
#

759 bots, I'm almost impressed in a way

tawny lava
#

My bots in a guild with 1k bots

#

Was*

neat falcon
#

hi how to fix (node:5196) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): #<Object>

#

@everyone

slow elk
#

That's disabled XD

quasi sandal
#

oh realy?

slow elk
#

Yea

#

At least, it's not showing the yellow tag for me. And it didn't give me a notification

neat falcon
#
exports.run = (client, msg, args, config, yt) => {
    const Discord = require("discord.js");
    let song = args.slice(0).join(" ")
    const voiceChannel = msg.member.voiceChannel;
    if (!voiceChannel) return msg.channel.send(':x: Join a voice channel first');
    voiceChannel.join()
    .then(connection => {
        if (!args[0]) { return msg.channel.send(":x: I can't play nothing :^)") }
        if (msg.content.includes("https://youtube.com") || msg.content.includes("https://youtu.be")) {
            let stream = yt(song, { audioonly: true });
            const dispatcher = connection.playStream(stream);
            dispatcher.on('end', () => {
                voiceChannel.leave();
                msg.channel.send("Left the voice channel!")
            });
        }
        const YouTube = require('simple-youtube-api');
        const youtube = new YouTube('no token 4 u');
        youtube.searchVideos(msg.content.replace('play', ''), 1)
              .then(results => {
                msg.channel.send(
                    new Discord.RichEmbed()
                    .setColor("#34495e")
                    .setDescription("Now playing music in the voice channel!")
                    .addField(`Title`, `${results[0].title}`)
                    .addField(`Artist`, `${results[0].channel.title}`)
                    .addField(`Link`, `https://www.youtube.com/watch?v=${results[0].id}`)
                    )
                const stream = yt(results[0].id, { filter: 'audioonly' });
                const dispatcher = connnection.playStream(stream);
                dispatcher.on('end', () => {
                    voiceChannel.leave();
                    msg.channel.send("Left the voice channel!")
                });
            })         
        })
    }

just returns unhandled promise rejection Thonk

#

yes very shitty code (discord.js)

slow elk
#

Better than my codes

neat falcon
#

how 2 fix Thonk

vital lark
#

show error

#

and

#
const stream = yt(`https://www.youtube.com/watch?v=${results[0].id}`, { filter: 'audioonly' });
tawny lava
#

y args.slice(0)

neat falcon
#

idk

tawny lava
#

that does nothing

neat falcon
#

code is mess

#

ok will try

#

same error

#
(node:6760) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
thorny hinge
#

Oh so you want no error? @neat falcon

neat falcon
#

i'd like it to play

#

cause the play command not playing anything

thorny hinge
#

oh

neat falcon
#

just giving me that then nothing else

thorny hinge
#

cuz if u dont want errors, delete the code

neat falcon
tawny lava
#

let stream = yt(song, { audioonly: true }); this is incorrect as well

#

needs to be a filter

neat falcon
#

inb4 all the code is wrong mmLol

#

a filter? Thonk

tawny lava
#

like this const stream = yt(results[0].id, { filter: 'audioonly' })

#

pretty sure that's the error

earnest phoenix
#

Hmmm

neat falcon
#

hmm

earnest phoenix
#

Lel

fast pike
#

There is any bot that i can do prefix mute user and then automatically gives the user the role Muted and mute him?

thorny hinge
#

You setTimeout an async function the exact same way you setTimeout a normal function, right? Eyes

uncut slate
#

yes

thorny hinge
#

I wanna be able to set interval a function that uses the message parameter on the ready event, but the ready event obviously has no message object

#

How can I achieve this? MadThinker

shrewd field
#

Why would a bot in discord be offline?

#

with code and in a server

quiet bobcat
#

Because some people host the bot on their own computers

shrewd field
#

i have it on a online host

odd scroll
#

it probably stopped running

quiet bobcat
#

^^

lethal sun
#

or errors

quiet bobcat
#

^^

lethal sun
#

or wrong token

quiet bobcat
#

^^ again

odd scroll
#

wrong token caused it to error and crash ๐Ÿค”

#

#solved

tawny lava
#

Or if you're using heroku it goes down every now and then

lethal sun
#

nope it will only log the console saying wrong token provided

odd scroll
#

ugh...joke ๐Ÿ™„

lethal sun
#

no jokes here

odd scroll
#

๐Ÿšถ

shrewd field
#

not wrong token

#

no errors

#

nothing

#

it says online

mighty barn
#

Then your host sux

shrewd field
#

but the bot isn't online

#

my host is heroku

lethal sun
#

did you added a config var with your token?

shrewd field
#

yep

#

this is what the logs said

prime cliff
#

13 users, in 13 channels wait wut

shrewd field
#

idk

#

wait

#

i have more than that how

#

and it left my discord server

prime cliff
#

Dont expect your bot to get verified here if you dont even know if its working and online

tawny lava
#

It got deleted

prime cliff
#

Yea ik

tawny lava
#

Speaking of which, fix your eval @shrewd field

#

It was open

prime cliff
#

oof

shrewd field
#

ok

uncut slate
#

@thorny hinge what you're asking makes no sense to me, the ready event doesn't have a message parameter because the ready event isn't a message event

thorny hinge
#

Im aware of that my dude

#

But I have a function that's supposed to spawn a coin every x minutes and I need to setInterval that function on the ready event @uncut slate

uncut slate
#

what

#

how do you mean, spawn a coin

#

you can just pick a random channel for that

#

client.channels.random().send('coin')

prime cliff
#

Or you could make a setup command to choose a channel and have it post in 10 mins :/

odd scroll
#

^

shrewd field
#

nvm

#

i found it

thorny hinge
#

Hm

#

Cool thx

shrewd field
#

hey

#

how do i get the name of each guild the bot is in

quasi sandal
#

@shrewd field more info, what language and lib?

prime cliff
#

@shrewd field Do you never read the docs its literally right there

#

READ ๐Ÿ“˜

thorny hinge
#
client.guilds.map(g => g.name);
#

You can do g.anyGuildProperty

#

Spoonfeed at its finest

earnest phoenix
#

Can anyone help me?

#

???

mighty barn
#

Maybe?

prime cliff
#

Do you need mental help?

thorny hinge
#

@prime cliff "Or you could make a setup command to choose a channel and have it post in 10 mins :/" I already have a setup command but how am I gonna start the setInterval for posting it in 10min? The sendcoin function requires a msg object (to find the channel) parameter but putting a setInterval on a msg event is not a good idea :/

supple shale
#

heroku

prime cliff
#

@thorny hinge Store the Guild ID channel ID then

#

Easy peazy

trim steppe
#

wow ken no spoon feed

prime cliff
#

Ur a spoon

thorny hinge
#

@prime cliff 3Deyes the ids are already stored lmao, but to access the database I have to do:

SELECT * FROM channels WHERE guildId = "${msg.guild.id}"

See msg
This is painful blobsad

#

And yes I use sql fite me

prime cliff
#

Its not a pain i have used sql/mysql before :/

odd scroll
#

I mean, you write the query once and you're find ... it's not that bothersome

tidal laurel
#

Does anybody know, how can i put my discord avatar on my webseite, so that automatic updates when i changed the my avatar image? (Web Development)

quiet bobcat
#

How do I make so when I type the command reboot my bot reboots and sends a message saying Rebooting... with async?

glossy sand
#

@tidal laurel I can only think of two solutions

#

you can make a bot that listens for user update events and put it in the same server as you

#

or you can periodically refresh a cached avatar on your server

#

@quiet bobcat you'll probably need some sort of bootstrapping program for your bot

#

you can use exit codes to indicate what to do when the bot shuts down

tidal laurel
#

mhh okay ๐Ÿ˜„

glossy sand
tidal laurel
#

How does Disocrd Bot List make it with the avatar? ๐Ÿ˜„

glossy sand
#

I wouldn't know, since I didn't write discord bot list

#

but I imagine they're using the bot method, which is why all bots and bot authors are required to be in this server

tidal laurel
#

yes that could be right thanks ๐Ÿ˜„

quiet bobcat
#

@glossy sand is it possible to do it with forever?

glossy sand
#

I haven't tried

quiet bobcat
#

Ok

undone plover
#

Can anyone help me with this: ```var rlsApi = require("rls-api");
var rls = require("rls-api");

var client2 = new rls.Client({
token: "I used to be a token"
});
var steamid = ${tempVars("steamid")}
client2.getPlayer("steamid", rls.platforms.STEAM, function(status, data){
console.log("-- Player Data:");
var display = (" Display name: " + data.displayName);
var Goals = (" Goals: " + data.stats.goals);
var Wins = (" Wins: " + data.stats.wins);
var ava = (" avatar: " + data.avatar);
msg.channel.send(display);
msg.channel.send(Goals);
msg.channel.send(Wins);
msg.channel.send(ava);
}
this.callNextAction(cache)

#

I get the error SyntaxError: missing ) after argument list

#

please tag me in the responce

unique star
#

you arent closing your getPlayer function

#

@undone plover

undone plover
#

where

unique star
undone plover
#

let me see if it works

#

then it just crashes my bot

unique star
undone plover
#

without telling me what is wrong

unique star
#

well

#

i mean its missing the ) there

#

so something else must be wrong now

undone plover
#

yes

#

it must

glossy sand
#

are you sure it's crashing?

#

check the exit code

undone plover
#

im sure its crashing

glossy sand
#

making assumptions is dangerous

#

you should still check just to be sure

undone plover
#

k

#

I don't get an exit code

glossy sand
#

...so the process doesn't exit?

undone plover
#

I don't know

#

I guess

#

give me a few mins

glossy sand
#

then how can you tell it's crashing if no error is being printed?

undone plover
#

because the bot goes offline

#

lel

unique star
#

bot goes offline != crash

glossy sand
#

I had a similar issue once actually

#

it wasn't a crash but I had a memory leak that made the websocket die

#

try running a profiler

undone plover
#

wait

#

the exit code is 1

glossy sand
#

so... it IS exiting?

undone plover
#

yes

#
                                                                            ^
#

I guess the it doesn't like the goals part

glossy sand
#

what error does it throw?

undone plover
#

TypeError: Cannot read property 'goals' of undefined

glossy sand
#

so data.stats doesn't exist

undone plover
#

perhaps it doesn't have the right info to get it

#

as in the steamid isn't showing up right

#

because goals is the first data it needs to get

#

well I tried to change something up

#
var rls = require("rls-api");

var client2 = new rls.Client({
    token: "no Token"
});
client2.getPlayer("tempVars("steamid")", rls.platforms.STEAM, function(status, data){
        var display = ("   Display name: " + data.displayName);
        var Goals = ("   Goals: " + data.stats.goals);
        var Wins = ("  Wins:  " + data.stats.wins);
        var ava = ("  avatar: " + data.avatar);
msg.channel.send(display);
msg.channel.send(Goals);
msg.channel.send(Wins);
msg.channel.send(ava);
})
this.callNextAction(cache)
#

still got SyntaxError: missing ) after argument list

glossy sand
#

what the heck are you doing in "tempVars("steamid")"

undone plover
#

I don't know

glossy sand
#

is that whole thing meant to just be one string?

undone plover
#

yes

glossy sand
#

you have to escape the inner " lol

#

otherwise js thinks you're trying to end the string "tempVars("

undone plover
#

ugg

#

how do I do that ?

glossy sand
#

backslashes

undone plover
#

thanks

earnest phoenix
#

@sly snow

steel heath
#

How to get online count on discord.js

young cradle
#

Filter users presence on <Client>.users collection

earnest phoenix
#

just played piano with a drunk brit for half an hour

#

it was beutiful

scenic crest
#

That's a very interesting coding story

earnest phoenix
#

Could somebody put me on the right track with communicating between a website and my bot (python)?

earnest phoenix
#

Guys, I need help coding a JavaScript Command!
Basically, my bot is in 353 Guilds so far, and I have seen that many of the users have been misusing my bot!
I am creating a command that whenever a user is caught misusing my bots commands, one of me Staff Members can ban or timeout the user from using the bots commands!

How would I do it?

Would I create an array?
Then use fs to write to it when the user is banned or something? I am clueless

thorny hinge
#

An array would be dumb lol

#

Use a database to store ids to blacklist

#

Arrays would reset upon reboot

fathom pebble
#

Send a message to a channel called #to-blacklist or something?

earnest phoenix
#

lol what about a JSON file?

#

Meh, would a JSON file possibly work?

fathom pebble
#

Yes, but don't make the file too big

earnest phoenix
#

Alrighty, cheers

#

I have another proiblem lol, You know normally when you place a bracket or speech marks it automatically places another one down for you, it doesn't do it for me,Any Idea why

fathom pebble
#

That's to do with your editor lol

thorny hinge
#

^

earnest phoenix
#

Goddamn it

thorny hinge
#

Are you using notepad

#

Or word

earnest phoenix
thorny hinge
#

Ah

#

I edit my code using visual studio code

fathom pebble
#

It stopped doing it for me as well on glitch

thorny hinge
earnest phoenix
#

It used to do it, didn't it lol

#

I wonder if anyone has posted about it on Glitch Forums lol

#

Ah, just checked, there is a simple code that you put in the web console in your project page:

application.editor().setOption(โ€œautoCloseBracketsโ€, true)
#

@fathom pebble @thorny hinge

#

I thinkl thats only for brackets though, not sure about others

#

Oh, i think im not too sure if it works, I get a syntx error O.o

glossy sand
#

@earnest phoenix you could run a flask server on your bot

narrow dagger
#

running flask and d.py in the same script is difficult.
You are probably better off having a database or using websockets

#

Unless you are using disco, or another library that doesnt use asyncio

abstract mango
#

well it's not difficult

#

you can put flask in on_ready

karmic lake
#

turtle

#

you turtley weirdo

earnest phoenix
#

Merry halloween!

karmic lake
#

@topaz fjord

topaz fjord
earnest phoenix
#

@umbral mauve thonk union

#

..

next bluff
#

what database are you using turtle?

earnest phoenix
#

wew

karmic lake
#

it says

topaz fjord
#

mysql

earnest phoenix
#

"mysql"

#

o

karmic lake
#

taht your using an incorrect string value

next bluff
#

I got the same error

karmic lake
#

for the column name

topaz fjord
#

i put text

earnest phoenix
#

just use oweiqtghewqoirgh

topaz fjord
#

as the value

next bluff
#

you have to switch your encoding and collation for the name column

#

to utf8mb4

#

this is why I regretted using mySQL

topaz fjord
#

how do you switch

next bluff
#

here's a guide

#

good luck

#

it's a huge pain

fervent goblet
#
justmaffie:~/workspace (master) $ sudo pip3.6 install aiohttp
The directory '/home/ubuntu/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
The directory '/home/ubuntu/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting aiohttp
  Could not fetch URL https://pypi.python.org/simple/aiohttp/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping
  Could not find a version that satisfies the requirement aiohttp (from versions: )
No matching distribution found for aiohttp
#

oh please go fuck yourself python

#

does anyone know why this is?

abstract mango
#

read it a bit

#

hint: look near the bottom

#

the ssl module isn't available

#

did you compile python yourself or something?

fervent goblet
#

yes

abstract mango
#

hmm

#

you probably didn't have a lib installed

fervent goblet
#

openssl-dev

#

which I installed

abstract mango
#

try installing libssl-dev

#

wait

#

which distro

fervent goblet
#

?

#

oh ye i mean libssh-dev

#

ssl*

#

I was confused

#

I installed libssl dev

abstract mango
#

oh

topaz fjord
#

@next bluff i did this ALTER TABLE userinfo CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; and ALTER TABLE userinfo CHANGE guildName guildName TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; and ALTER TABLE userinfo CHANGE guildOwner guildOwner TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; but i still get the error

next bluff
#

what do you get when you run SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';

topaz fjord
next bluff
#

did you put character-set-server = utf8mb4 collation-server = utf8mb4_unicode_ci

in your init file?

topaz fjord
#

init?

next bluff
#

well it depends on the OS. Is this on Windows?

topaz fjord
#

linux

#

i have a my.cnf

next bluff
#

are those lines in there?

topaz fjord
#

yes

next bluff
#

have you tried restarting the database?

topaz fjord
#

i did this

#

mysqlcheck -u root -p --auto-repair --optimize --all-databases

next bluff
#

I would also make sure that collation-server and character-set-server are not in any other .cnf files

#

because they could override your setting

#

I don't think the auto-repair thing will reset your utf8 settings

#

you will need to restart the service

topaz fjord
#

ill check them

#

how do you restart the server

#

service

next bluff
#

might depend on your distro but generally service mysql restart should do it

topaz fjord
#

oh wait

#

after a fullr estart it worked

#

thanks

next bluff
#

no problem

fervent goblet
#

so many new mods

#

I'm jealous

topaz fjord
#

so

#
settings.query(`INSERT INTO userinfo (guildName, guildID, guildOwner, guildSize) VALUES (?, ?, ?, ?)`, [message.guild.name, message.guild.id, message.guild.owner.user.tag, message.guild.memberCount])
#

for this

#

i set guildName as text

#

with single quotes around it

next bluff
#

is that node? I can't say I've ever used that but I'm guessing when you use a parametrized string like that it will look at the type of column and put single quotes around it if it's a varchar

topaz fjord
#

it is nodea\

#

*node