#development
1 messages ยท Page 354 of 1
why do you want a blocking request
also that looks like js
you can make an async callback-based request return sync though
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
What would be the best to save a player's score (website game)
client or server side?
Server side
just a plain score, number?
do u have a user id?
you could use redis
players:<ID>:score
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
Yea but
corrupts easily, won't work concurrently
shooting yourself in the head is also easy, but that doesn't mean it's a good thing to do
Json would be a quicker easier solution
Im not saying its better just two options he has
rethink stores as json
hate and love json files
Cassandra is nosql and doesnt store as json afaik (correct me if wrong)
^^^ love it for configs
redis can store json too
Json is litterally just for settings
as strings
Redis and json makes sense imo, since it's meant for caching
I havent ever touched redis
I just do good ole mongodb for all my projects
@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
Is redis something yall would highly recommend me lookin into?
Yeah
I use Redis for caching only
Although SQL is definitely a useful skill
it's not very good at storing complex data but as a cache/simple kv storage it's awesome
And for big bots you might want a more redundant database
It's good if you use it right
Music queues -> redis(ram)
Level system -> maria/mongo/etc
there's hashes (basically key->key->value), lists, sets, sorted sets
Oh
I think of redis as "if server crashes, it doesn't matter that i lose everything on redis"
you can have it saving to disk
I use it as temp cache
๐ค intresting ill check it out once home from worj
Yea for learning any library ect i litterally just look at docs and an example on github
People underestimate docs
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
Rip
๐ ๐ก
Out of date docs are pretty much worst then no docs
Ya
Because u think your doing it right because docs say so then u find out your code is fucked
When something doesnt work, I also check their repo issues section. I can't be the only one, hopefully
๐
If you want your bot to send animated emojis follow these steps:
-
Add an animated emoji to a server where your bot is. Basically add a .gif file as an emoji.
-
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.
somebody send the wumpus imma test
@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
Huh? I saw some talking about redis
someone said its great for kv storage
I definitely agree with that
I wouldn't have two NoSQL together
why
I'd rather use Redis with something like PostgreSQL
how so
Redis, Mongo and other NoSQL databases have a tendency to use in-memory databases
in my experience you don't even need an SQL
same array
I hate sql
but persistance is rip
I don't store everything in Redis
Me too
its about 50/50 mongo/redis
I might look into Rethink
both critical parts of projects
I think that one does immediate writes
rethonk*
if mongo goes down my bot is fucked
depends what you need it for
if redis goes down my bot is fucked
re
yeah I have considered looking into it
but I am waiting till my new pc
i've been using only redis for months, zero data loss
data.json feels
store the redis url in redis
because embedded-redis can be a bitch some times
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
I switched to redis because it lags SCP clients
Not because it didn't work
And kv storage is perfect for my current usecase
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?
oh nvm
the docs should tell you
so I can display that in stats
actually I think I got a better way
well
easier
What I do atm, but I dont' require sharding yet, is just post total guild count only for shard 0
I don't know
Since I don't care about those stats I haven't looked into them
Read the docs
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
thats an ugly way, tbh
why not just id
and filter with the formula
shard_id = (guild_id >> 22) % shard_count
I want to find the amount of guilds on the shard
or smth like that
same concept
but you are right
discord.py has a similar thing
discord.utils.get
I totally friggen forgot
thanks
How do I make an exec command in discord.py?
like
p!exec git pull
that would return the result
and send it pagified
parseFloat("2.33").toFixed(2) + parseFloat("2.33").toFixed(2) gives 2.332.33
Not 4.66

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
fuck php
I see no difference from what you just posted to my code
Anyone know how 2 make a nice progress bar, with uh liquid animation in it? Actually, I could probably just use css and jQuery 
bootstrap does that pretty nicely
but that might be overkill if you don't need it for anything else
You can just take the bootstrap css you need
I have been starting using bootstrap-grid, which is the only thing I care about
lmao no why
Can I get some help.
var nice = new DiscordEmbedBuilder()
{
Title = $"{ctx.Member.Username}: Here are Yone\'s stats.",
Color = new DiscordColor(0xBA68C8),
Fields = {} //<---- how do I use this
};```
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
I figured it out
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```
if (!server) return;
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:");
No
I don't understand
If that's the unicode ๐
ok
๐
Actually that would be the better option ^
message.react("๐")
With the unicode
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
i use this option:
mesaage.react('\๐');```
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
Yes
I would use the async/await
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
But it just reacts one
message.channel.send(embed).then(message => message.react("๐")).then(message => message.react("๐"));```
Yeah
But can I see your message event?
I might know why you can't use async/await
yes
Switch to this:
bot.on("message", async message => {
And when you do your message handling, the end will be });
yeah
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()

gg
thanks atmg
No problem
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
mm
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`
Help?
youtube
@wise nexus no perms to ban?
i have perms
let try something brb
Alright
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?
users
for loop of every guild
Are you sure he said that?
Actually, what do you want to achieve to be exactly
are you trying to addd every user to an array?
what do you mean? How are you caching them?
so... are you trying to get a number for every user?
Yes.
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
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
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?
Why not store it as a variable, then create an embed using said variable.
I tried that aswell
Try.Then.Catch
Use an if check in the variable.
try debugging that function
I know it works because I tried console.log(characterLocation(con, message)); and it returns what's intended to return.
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()
it returns that as a string
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
oh so there might be an error and not getting past the if
ok, thanks! I will look into that
function idk(interval, duration){
alert("oof");
setInterval(idk, interval);
}
How can I clear this interval after some period of time

add a setTImeout
is there a meaningful way to verify that the owner of a bot does, indeed, own the bot?
Without it's token, no
mm
discord should add more api functions
love too, discord api
for example /users/<id>/profile for bots
/oauth/apps/<id>
with info such as owner
bot id
rich presence crap maybeh
I guess I can just add a report button and ipban people who register bots that aren't theirs
My question is why getting application info is restricted behind an authorization
Shouldn't that info be public?
well novus
it's a secret
its not that easy
sure it is ๐
Phanta can ya tell me in dm? I'll keep it private
nah
I can help dev
nah
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
๐ณ ๐ฆ ๐ญ
not me
@glossy sand what was that passport thing that you made?
code as ?code=lolnofuckyouthisisaninvalidcodeforanyoauthapplicationwhateveryouwant
not for react is what it is
I don't want it for react tho
unless you want to use my extremely unstable and probably-not-ready-for-production webapp lib, you don't need it
ur a floof
So I am Phanta's ExpressJS replacement?
Easy store all passwords and tokens in plain text files
is there some way to get information about a bot from discord api
without a bot account, that is
@glossy sand 
No not really
But most bot listing sites already have apis for that
Thats enough for me
I don't want my service to depend on dbl lol
is 192 bits of entropy enough for an api token lol
Am i able to make my bot change its game every couple of minutes? In JavaScript if so... how?
I've seen bots that do that though?
Same
the limit is 2 times per hour
30 mins then
but I mean if you're abusing it for some reason, the discorders will still ban you
You know how to do it?
discord.js?
Correct
Ik how to set the bots game but idk how to loop it every 30mins
I'm blind sorry
Lol np
I don't remember the rate limit for setting games, but it's definitely not 2x per hour lol
Oh lol
what you can do is use a setInterval to run a function intermittently
Okay lol cheers bud, do i use it in the same way as setTimeout? Woth the time in milliseconds
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
Mk
bad idea if you ratelimit your game change though lol
Discord kicks you off the websocket
Im setting it so it changes rvery minute
Lol yeah
The ratelimit resets every minute or so iirc
Lol okay good
So once per minute definitely won't do anything bad
e
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
for anyone who cares
/(?<=Core \d:\s*\+)\d+/ works
positive lookbehinds, but it's not on LTS
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.
maybe the npm docs for those modules have something for duration?
That could work
@quiet bobcat duration of the whole song or the duration it has already played
The whole song
oh well nvm
So I want to use a custom emoji from my server :pepe:394859125240234005 But instead of the emoji, it just shows :pepe:
@neon pasture d.js?
eris
o idk
how do you do it for d.js then?
d.js it's message.client.guilds.get(emojiServer).emojis.find('name', 'pepe')
i think
But I want that you can use it on every server.
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)```
no it's like :pepe: and then the id
like add <>
I think it's <:pepe:idgoeshere>
I did
hm
But it wouldn't show in this message then xd
Are you sure it's the right id?
ye right forgot about that cd
is it an animated emote @neon pasture 
!EYES

the only reason i could imagine why it wont work
is that its not in the same guild
It is.
well
c'mon m9
I already answered
does the bot have external emojis permission?
it is in a embed
that too
Let me check that

๐ข

๐
Someone knows how can I do a message that edits every seconds and make a countdown ?
mmm rate limits
js
That's not a lib

lib = library
Could be eris
Alrighty
-bots @shut wave noembed
๐ unbelievable ๐#9038's
bots:
@limber sphinx
@steep horizon
Hasuko#2043's bots:
@inland mist
Mobile problems
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โข

ur gonna have to setTimeout
The function
10 times

Idk actually
If that would work
Probably won't
๐
i'll see
Ok I finally got it
It worked? @shut wave I wouldn't think it would
I used what you give me with other things, ye
sup
If I have a bot that is for 3 weeks offline will get out of the list and kicked from the server
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
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?
worst part about go imo are gc pauses
but it's good for concurrent applications
channels and goroutines make concurrnecy really easy to do
@shrewd field no need to worry, your bot has already been deleted

-bots @shrewd field
This user has no bots

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
Try literally any other thing inside #312614469819826177
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!! 
"Try metaphorically any other thing inside #312614469819826177" would be better
Thank you for your time
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
Anyway, to #memes-and-media if you wanna continue
btw, I'm looking for someone that has experience with discord.js to give me some feedback on a project of mine
me
equally lmfao
https://npmjs.com/package/discord-command-parser @drowsy yarrow
use discord.js-package
it may get people confused, if you use discord-package
( I mean, there's 4 libs for js )
Just wanted to warn you guys about this server, it looks like they might be getting most of their bots from the site. You may want to blacklist it as I did
759 bots, I'm almost impressed in a way
hi how to fix (node:5196) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): #<Object>

@everyone

That's disabled XD
oh realy?
Yea
At least, it's not showing the yellow tag for me. And it didn't give me a notification
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 
yes very shitty code (discord.js)
Better than my codes
how 2 fix 
show error
and
const stream = yt(`https://www.youtube.com/watch?v=${results[0].id}`, { filter: 'audioonly' });
y args.slice(0)
idk
that does nothing
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.```
Oh so you want no error? @neat falcon
oh
just giving me that then nothing else

let stream = yt(song, { audioonly: true }); this is incorrect as well
needs to be a filter
like this const stream = yt(results[0].id, { filter: 'audioonly' })
pretty sure that's the error
Hmmm
hmm
Lel
There is any bot that i can do prefix mute user and then automatically gives the user the role Muted and mute him?
You setTimeout an async function the exact same way you setTimeout a normal function, right? 
yes
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? 
Because some people host the bot on their own computers
i have it on a online host
it probably stopped running
^^
or errors
^^
or wrong token
^^ again
Or if you're using heroku it goes down every now and then
nope it will only log the console saying wrong token provided
ugh...joke ๐
no jokes here
๐ถ
Then your host sux
did you added a config var with your token?
13 users, in 13 channels wait wut
Dont expect your bot to get verified here if you dont even know if its working and online
It got deleted
Yea ik
oof
ok
@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
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
what
how do you mean, spawn a coin
like the nekos in #265156361791209475?
you can just pick a random channel for that
client.channels.random().send('coin')
Or you could make a setup command to choose a channel and have it post in 10 mins :/
^
@shrewd field more info, what language and lib?
client.guilds.map(g => g.name);

You can do g.anyGuildProperty
Spoonfeed at its finest
Maybe?
Do you need mental help?
@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 :/
heroku
wow ken no spoon feed
Ur a spoon
@prime cliff
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 
And yes I use sql fite me
Its not a pain i have used sql/mysql before :/
I mean, you write the query once and you're find ... it's not that bothersome
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)
How do I make so when I type the command reboot my bot reboots and sends a message saying Rebooting... with async?
@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
mhh okay ๐
How does Disocrd Bot List make it with the avatar? ๐
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
yes that could be right thanks ๐
@glossy sand is it possible to do it with forever?
I haven't tried
Ok
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
where

without telling me what is wrong
im sure its crashing
...so the process doesn't exit?
then how can you tell it's crashing if no error is being printed?
bot goes offline != crash
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
so... it IS exiting?
what error does it throw?
TypeError: Cannot read property 'goals' of undefined
so data.stats doesn't exist
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
what the heck are you doing in "tempVars("steamid")"
I don't know
is that whole thing meant to just be one string?
yes
you have to escape the inner " lol
otherwise js thinks you're trying to end the string "tempVars("
backslashes
https://www.w3schools.com/js/js_strings.asp check out the "Special Characters" section here
thanks
@sly snow
How to get online count on discord.js
Filter users presence on <Client>.users collection
Could somebody put me on the right track with communicating between a website and my bot (python)?
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

An array would be dumb lol
Use a database to store ids to blacklist
Arrays would reset upon reboot
Send a message to a channel called #to-blacklist or something?
Yes, but don't make the file too big
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
That's to do with your editor lol
^
Goddamn it
no lol, Im coding my bot on glitch.com
It stopped doing it for me as well on glitch
And put it in glitch.com
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
@earnest phoenix you could run a flask server on your bot
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
Merry halloween!
@topaz fjord
what database are you using turtle?
wew
it says
mysql
taht your using an incorrect string value
I got the same error
for the column name
i put text
just use oweiqtghewqoirgh
as the value
you have to switch your encoding and collation for the name column
to utf8mb4
this is why I regretted using mySQL
how do you switch
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?
read it a bit
hint: look near the bottom
the ssl module isn't available
did you compile python yourself or something?
yes
oh
@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
what do you get when you run SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';
did you put character-set-server = utf8mb4 collation-server = utf8mb4_unicode_ci
in your init file?
init?
well it depends on the OS. Is this on Windows?
are those lines in there?
yes
have you tried restarting the database?
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
might depend on your distro but generally service mysql restart should do it
no problem
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
so when i insert does it insert message.guild.name
with single quotes around it
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






