#development
1 messages · Page 456 of 1
(waps sowwy i am dum boi lol)
(yeah, I didn't see an endpoint for it or anything in the docs lol)
(shh 😉)
@sick cloud - is there a reason my bot would be approved but not in the channel?
simple question how do i get my bot username and tag using eris
i gave a quick look over the docs but didnt find it
im either blind or its well hidden
bot.user is a User. that has username, discriminator, avatar, etc
so
bot.user.username ?
anything a User has https://abal.moe/Eris/docs/User
Eris, a NodeJS Discord library
k
Hello
My bot got muted because it responded to another bot
I have fixed this issue in its code
Could I get it unmuted please?
ah, looks like my bot was kicked due to DMs on guild join. That functionality has been removed, is there a way to get the bot re-added?
Thanks @sick cloud
np
do i need to change anything here in order for the webhook to post in a specific channel? or would that go on the DBL Bot Edit section?
looks like thats posting into a database?
okay also Is this correct?
http://bit.ly/2LB3PMQ
http://bit.ly/2mQuVR7
http://bit.ly/2mRudmT
i want it to post to a channel when someone votes..
@sick cloud
You have to communicate with the bot to send the message.
I don't work with PHP so dunno
LOL PHP
is it possible to change the text color when using canvas-constructor?
@rain orbit lol google
and wtf why everyone use canvas constructor
cool
@dull breach can I look at your canvas code, out of interest
@gilded plank botinfo @frosty flax
464747957288435732
expoBot
1211
Just a bot that you need.
discord.js
12
11 Servers
@dull breach
Invite | Website | GitHub | Support Server
check git
Thanks friend
ill rewrite it soon
Did you think that bot can use animated emoji ? like a Nitro ?
bots can use animated emojis
Owo
do i can use gif avatar? without nitro
No
:(
but animated emoji
oh
btw i won't buy nitro
no, how it should be is that you should have an option to pay nitro for a bot account
that's the best way for discord to make MOAR MONEY
it costs nothing
haha
i mean no
i live in Russia
i havent so much money
yes but per bot account
or fix their broken api
you dont even get to use it
whatever's broken in their shit
discords gay ass crashes
if paying 5$/month per bot reduce discord's ridiculous amount of crashes by even 1%
i'd pay
lol
id maybe pay for a really good bot
not some shit bot i have listed here i dont care about
lol
why do you list them if you don't care about them
@gilded plank botinfo @finite plank
# modlog
@bot.event
async def on_message_delete(message):
if logdb.contains(Users.server == ctx.message.server.id):
```
This is my current code using TinyDB and Discord.py, how can I get the channel ID and store it as a variable?
It already checks for the server if it's been allowed to modlog but I don't know how to get it to read my channel var.
This is the DB layout.
[{'server': '264445053596991498', 'channel': '265156361791209475', 'log': True}]```
get the channel from the database?
idk how tinydb works, but in rdbs such as mysql you need to extract the column from the row, for example (pseudocode) GET channel WERE server === server.id
Okay, I'll try that logic then.
if Users is your db table
It's logdb, Users is to query it
then you need to get channel from the row where Users.server == server.id
ah i see, but you need to check what's the proper syntax for tinydb
i took a look at the docs, it seems its a json database, then your approach should work. the database returns the entire row
then you get the channel from the row, just like you would get any property from an object
yeah, doing db.search returns the whole line
Hi, I maked image generation command but I have to set a timer before the image send, 2s work fine but when the bot is very used, these 2s are too low and i have to set it around 7-8s but it's too long.
If I just set a delay it's because without it, on big images, it will try to send the image before it's generated.
I've tried to use an : await message.channel.send but it just don't change anything
if someone can help me, it will be very nice
using Jimp in node js if i'ts important
https://hastebin.com/ponipifena.js
anyone know why this returns the message it does in the comment i showed? i cant really find out why
gRole is undefined because it cant find a role with the name, probably because it doesnt exist/you are using .find with the wrong name.
console.log(role) and see what it is when you use the command "correctly"
okie
Also , if the usage is "Usage: !addrole <user> <role>", the role name would be args[1], right? So why are you doing:
let role = args.join(" ").slice(22);
That magic number 22 is probably where you issue stems from.
yeah and it makes no sense, use args[1] and just print the role variable to see what it is.
did you switch to using args[1]?

uh what is wrong with that plz ?
var i = false ;
while (i == true) {
try {
const copie = new Discord.Attachment(file);
message.channel.send(copie)
i = false;
} catch(e) {
console.log("One error, retrying")
}
}
The image file take time to be created so, I tried that but il stay on the catch to infinite even if the file is ready (and then ,it have to work with the try)
why are you doing .then.then instead of .then ??
no it's not a .then.then just have that :
Promise.all(jimps).then(function (data) { return Promise.all(jimps); }).then(function (data) {
data[1].resize(155, 155)
Jimp.loadFont(Jimp.FONT_SANS_16_BLACK).then(function (font) {
data[0].composite(data[1], 25, 70)
.print(font, 55, 235, toto)
.write(wanteduser);
I tried something else but the loop and the catch won't work, this is all the code :
if (msg == ("WANTED")) {
var wanteduser = sender.username + ".png"
var imagesT = ['./images/Base/petit.png', sender.displayAvatarURL], jimps = [], mise = Math.floor((Math.random() * 1000000000)).toLocaleString(), toto = mise + " $"
for (var i = 0; i < imagesT.length; i++) jimps.push(jimp.read(imagesT[i]))
Promise.all(jimps).then(function (data) { return Promise.all(jimps); }).then(function (data) {
data[1].resize(155, 155)
Jimp.loadFont(Jimp.FONT_SANS_16_BLACK).then(function (font) {
data[0].composite(data[1], 25, 70)
.print(font, 55, 235, toto)
.write(wanteduser);
})
})
var compt = false;
while (compt != true) {
try {
const copie = new Discord.Attachment(wanteduser);
message.channel.send(copie);
compt = true;
} catch(e) { console.log("erreur") }
}
} ```
In the catch, I can say it to just write "erreur" in the console but it will not do it, it will just that it don't find the file (that is created around 2s after the error) and it will stop there, the loop will not restart
how do i make a say command can i get some help
The aim of the loop and the try catch is for wait for the image generation, I've tried use await but don't have results too (maybe because I don't know how to use it in my case but i've put an await at the const copie = await Discord.attachment....
and an await message.channel.send but it wont't worked
my bot is in javascript
i think this is my 1st time doing js
i mosty watched youtube vids on how to do this but i cant find how to make a say command
just said you what you have to do atomic, read what ive said
split it by space, slice it and join it by space
you do that to the message.content
If someone can help me plz :
https://canary.discordapp.com/channels/264445053596991498/272764566411149314/473521469440131083
Hmm, nobody seems to find either, not bad I'll put abandoned the idea for the moment, bye ^^
I'm trying to update my bot's server_count, but I'm getting this error:
aiohttp.errors.ClientOSError: [Errno 101] Cannot connect to host discordbots.org:443 ssl:True [Can not connect to discordbots.org:443 [Network is unreachable]]
I'm using discord.py
Anyone know what might be up?
Relevant code snippet:
import aiohttp
dbl_token = ""
with io.open("tokens/lmao-dbl.txt", "r") as token:
dbl_token = (token.read())[:-1]
dbl_url = "https://discordbots.org/api/bots/459432854821142529/stats"
dbl_headers = {"Authorization" : dbl_token}
@bot.event
async def on_ready():
payload = {"server_count" : len(bot.servers)}
async with aiohttp.ClientSession() as aioclient:
await aioclient.post(dbl_url, data=payload, headers=dbl_headers)
Never mind, I fixed it by adding dbl_connector = aiohttp.TCPConnector(family=socket.AF_INET,verify_ssl=False) and adding the kwarg connector=dbl_connector to aiohttp.ClientSession()
How would i pin a message with discord.js
I've looked at the docs but can't get it to work
@glossy talon You’ll get better information at #topgg-api but it involves webhooks
@earnest phoenix What error are you getting?
Use the pin method of a message object
@earnest phoenix you shouldn't start with bots, learn some basic node.js first.
Is commando necessary for making a DB connection to sqlite? Or in other words does it make working with a DB easier? If not what other tools can I use with discord js to do that?
Any suggestions?
Try to module that commando uses to connect
Do you mean SyncSQLiteProvider?
I don't know much about commando or sqlite, haven't used either. I use Mongo and a custom command handler
I don't want to just use sqlite for putting guild settings
Ah okay
I'll keep searching
I recommend rethink if you're starting out with database stuff, it's easy and quick
Mongo if you're more advanced
The era is SQL is coming to an end
I've worked with databases before, just not much practice with connecting to a DB using node js/discord js
I'll check out mongo.
honestly you'd just connect it like any other application
Mongo is dope
@sick cloud I'm more asking for like syntax or correct use, etc.. or like a package that makes working with DBs easier
well
With sql or mongo?
Is you use mongo I recommend Mongoose
Glad to help :)
https://www.hastebin.com/ewibupixew.cs I am having trouble with this command it is not working
What's the error? You're going to need to give us more info
If I had erros I would supply them
It just doesn't send out anything
no errors
or an embed
place a bunch of console.log() at key points and watch the data flow
Idk what to console log to even get the data :/
I tried console logging things
Nothing is happening
That probably means that your code isn't reaching there
ok
how are you console.logging?
Anyone here use the jovo framework
app.setHandler({
'LAUNCH': function() {
this.toIntent('HelloIntent')
},
'HelloIntent': function() {
this.ask('Hello, ask my anything!');
},
'Gas': function(type, place) {
if (!this.googleAction().isPermissionGranted()) {
this.googleAction().askForPreciseLocation('Sorry, you need to give me access to your location to use this action!');
return;
}
console.log(type)
console.log(place)
this.ask('ok')
},
'ON_PERMISSION': function() {
if (requestUser.permissions.indexOf('DEVICE_PRECISE_LOCATION') > -1) {
let device = this.googleAction().getRequest().getDevice();
console.log(device);
this.tell('Thanks for your precise location');
}
}
});
ive been trying this to get the users location for google assistant
it tells me this when i type the trigger for Gas
"Sorry, you need to give me access to your location to use this action!, I'll just need to get your street address from Google. Is that ok?"
i dont understand how the user is supposed to accept
whenever i type in "yes" it goes to the fallback intent and not ON_PERMISSION
It's for a Google assistant action
So it is asking for their location?
In the gas part yes
Seems fishy
But I don't see any place or way to confirm
Many Google assistant actions require your location
That's how they do the near me
It's not for discord
why not just look it up on your phone
It's for something else
A Google assistant action
oh nice
Fuck
watch ya profanity
@earnest phoenix no need to mini-mod
....
Lmao
mini-mod
Not my fault I value what little kids hear
They shouldn't hear them cuss words
bad influence
now get out of development if your not going to be talking about bot development
some mild profanity is perfectly fine here
seriously, out. 
how would i go about sending a image using discord.js?
@viscid falcon you would look at the discord.js docs here:
https://discord.js.org/#/docs/main/stable/class/TextChannel?scrollTo=send
And find the examples:
// Send a remote file
channel.send({
files: ['https://cdn.discordapp.com/icons/222078108977594368/6e1019b3179d71046e463a75915e7244.png?size=2048']
})
.then(console.log)
.catch(console.error);
// Send a local file
channel.send({
files: [{
attachment: 'entire/path/to/file.jpg',
name: 'file.jpg'
}]
})
.then(console.log)
.catch(console.error);
thank you
why does this keep giving me message.author.setNickname() is not a function?
because your trying to set the nickname of a user, not a GuildMember
users don't have guild-specific properties
oh duh, thanks
yeah
i changed it to message.member.setNickname... but now its giving me a DiscordAPIError: Missing Permsissions
the bot has to be above the user role or permission wise to do so
and have the manage nicknames permission
How would I make my command "serverinfo" display server owner?
<guild>.owner
fuck me im so tired
soo many fucking edits
but theres your answer
Learn simple JS code
It makes me cringe at peolle
ikr esp when im tired
Shouldn’t be making a bit if you don’t how to code simple shit
im like do i have to deal with this?
Bot*
Look at an open source Bot lmfao
lol ikr
Better than asking someone
especially since theres different languages and libraries
oki sry and gnite @sick cloud
gn and kek
ok so i have this code https://hastebin.com/xixohagoho.js the top part for message edit works but when i pin a message or unpin it doesn't work. no errors, and as you can see i've tried the console log method, it doesn't even get to 1 apparently
like, nothing outputs to console
if it doesn't go to console.log('1') that means it's returning something before then
which means it's reading line 8
if (msgBefore.content !== msgAfter.content && msgBefore.embeds === msgAfter.embeds && msgBefore.pinned === msgAfter.pinned)
as true and going into that if statement and returning the embed there
that is what I would assume unless something else is also interfering
@sick cloud ^ ?
check if your if statement is what you want
Yeah that means it triggered the first if statement and returned after that
no it can't be @fluid basin @hallow harness because the embed for that if statement never sends
its like the event is never fired when the pin happens
uuuh
have you tried adding a console log inside the if statement?
see if that goes or not
to confirm whether or not it's entering the if statement
i'll try that later
what lib you in?
bot.guilds.size
thanks 😃
how would make a discord inner embed
@earnest phoenix can you explain?
send embed xD
ah
2 ways here:
- If you r really lazy you can write
message.channel.send({ embed:{"..."} })
Use embed visualizer to create embeds it this way - Create a new Discord.RichEmbed()
.setSomething();
And then just write a name to message.channel.send()
im writing on djs, just notice
@earnest phoenix the screenshot you showed is a rich embed
@earnest phoenix you mean you just make the json? thats easier to preview cuz of the visualizer but it doesnt let you add/remove fields
oh
yeah i just manually make it. i think a few of my commands i just push the field object to fields array lol
is it
ye that's what i do too
and that's what d.js's embeds builders do in the background anyway
yeah forgot to mention im on eris so dont think theres an embed builder anyway
nop there isn't indeed
sorry i didn't notice
ho how do you do that cool thing so i can send some code and it will look nice
hi how do i defind msg
defind msg????
defined msg
defined msg???
im makeing a bot for discord and is say msg is not defined
then define it?
idk how
research it on the documentation of the library you're using
Is message.channel.send() a promise function
Ok
👍
Thonk you
how do i know which classes these belong to
Im not discord.py so i cant help you
@earnest phoenix then don't respond
👌
The functions?
@worldly sigil if you are using d.py async version i strongly suggest you upgrade to d.py rewrite, since d.py async is feature locked. also look at this documentation: http://discordpy.readthedocs.io/en/rewrite/api.html#event-reference
So I'm noticing with @spice wren that it manages to embed links in the now playing embed with titles to the links instead of the raw URLs
Does anyone know how a bot can accomplish this? I'm not finding anything on specifically texting a URL in the API docs
Use markdown
[link](text)
Its supported in embeds
that's a markdown feature only supported in embeds
tbh bold, italics, underline and strikethrough all use the markdown format
Well yes of course, but I always had the idea in mind that Discord purposefully had a limited version of markdown to prevent against malicious link texts and images and things like that
It's neat to see that a bot has more access though
discord indeed has a limited implementation of markdown, i think it wasn't specifically meant for bots but rather for internal purposes but eh
In any case it works how it is so I'm fine with that
@heady zinc Sorry for the tag but seems it didn't work :c
uh lemme check something very fast
Pretty sure its the other way round
Oh wait
[text](https://memes.com) works
btw, it also works in non-embed webhook messages
Ooo
does it 
yeah i use it in a command
i have a hook command which makes a webhook that looks like you and sends the text
Wow that actually looks nice
impersonifying users 
How do I run command checks in d.py if the command is cogged, my code is
owner = "372931332239654912"
def ownercheck(ctx):
return ctx.message.author.id == owner
@commands.check(ownercheck)
@commands.command()
async def leaveguild(self, id):
"""Leave a guild."""
toleave = self.bot.get_server(id)
await self.bot.leave_server(toleave)
await self.bot.say("Left {0} (`{1}`)".format(toleave.name, toleave.id))```
I had someone who isn't owner test it and he managed to run the command.
Checks work now, just had to rejuggle my code a bit.
Now embeds don't work
I need help with rich embeds in d.py cogs, I can't even load the cog nor are any errors printed in the console.
@gilded thunder You still need help?
The code here doesn't even use embeds tho
What do you want to do? Have you looked at the documentation?
Are there docs for cogging?
0.16
Here's an example gist for using cogs: https://gist.github.com/leovoel/46cd89ed6a8f41fd09c5
That's where I got the basic addcog bit.
Nicked some commands back when I first made the bot too
Lol gj
Well, if you have a working cog and you want to use embeds, then you can read about embeds from documentation: https://discordpy.readthedocs.io/en/latest/api.html#discord.Embed
Whats the code for when a bot joins a voice channel and he deafens
Can someone help me?
@tribal hazel i'd be nice if you specified language and library you use
discord.js?
Yes.
have you checked the docs?
Not yet
well what are you waiting for
i think this is it: https://discord.js.org/#/docs/main/stable/class/VoiceConnection?scrollTo=voiceManager
But what I want isnt on there
what are you using for joining the channel
i k
Like dabbot
what are you using to join the vc
YTDL-Core.
let connection = await message.member.voiceChannel.join();
let dispatcher = await connection.playStream(ytdl(args[0], { filter: 'audioonly' }));
message.channel.send(`**${message.author}, I am now playing ${info.title}! :play_pause:**`);
} ```
Get the voice channel, join, get the connection from what is returned from join, and just use https://discord.js.org/#/docs/main/stable/class/GuildMember?scrollTo=setDeaf
The bot to deafen so..
Whe it joins it deafens..
SetDeaf..
client.user.setDeaf
?
That is not a guildmember object
show code
module.exports.run = async (client, message, args) => {
dispatcher.pause();
message.channel.send(`**<@${message.author.id}>, I have just paused the current song! :pause_button:**`)
}
Help.
what
its not working because dispatcher isnt defined
in your play command you should have a message collector
@abstract crystal that's so much more readable thx
np
Good evening to all
you know how I can keep my bot connected to my server without putting it on the host or VPS?
ummmmmmmmmmmmm

You do realize bots don't run in the aether
And VPS only costs you like 3 or 4 $ a month
and then how can I do it online?

and I do not want to pay for a bot!!
too bad, nobody is going to host your bot for free
(and when you see a free "product" know that you are the product and most likely company will sell your info)
they told me that I do this without being hosted by someone but I do not know how to do it and neither the one who told me knows
Can you host it in your own computer?
I host mine on someone else's computer for free because I made a bot for them, but that's not an every day occurrence.
i can not keep my pc open
well, then you see, VPS is the perfect solution
it's cheeper than paying for the internet and the electricity your computer will use hosting your bot
The biggest issues would be you not having a internet chargeable card (credit or debit+) or you not knowing any bash commands
OK thank you very much for your help
and I can find this way to let you know so you can know it
No thanks, I already have my bot running on a VPS I pay $4 a month for
and how can I pay if I do not have a credit or debit card on the internet?
Does paysafe accept the vps you are?
so im having a bit of trouble starting my bot
im using the python api documentation but a lot of stuff seems ambiguous
to start i created a 'MyClient' class and extended the discord.Client() class
and im not sure where to go from there
What python lib you using?
uh
not sure?
im using python 3.7
and then did the pip install discord.py[voice]
So you using discord.py, I see
1st, if you are making a bot, you want to from discord.ext import commands and use commands.Bot instead of discord.Client
There is none, commands.Bot is a subclass of discord.Client
it's just that Bot has builtin command making tools
Then read the documentation and look at the example bot: https://github.com/Rapptz/discord.py/blob/async/examples/basic_bot.py
You don't even need to subclass the bot unless you want to overwrite something in there
Very little as you can just use cogs
or playing music
Those, not at all
oh ok
I was more thinking if you want a complex prefix finding system then you might need to overwrite get_prefix or something
exclamation point prefixes are fine for rn
Yeah, for example this is my get_prefix I have overwritten: py async def get_prefix(self, message: discord.Message): if isinstance(message.channel, discord.DMChannel): return [ f'{message.channel.me.mention} ', "".join(itertools.takewhile(lambda k: not k.isalnum(), message.content)) ] # mention needs to be first to get triggered return await super().get_prefix(message)
It makes it so that DMs don't need a prefix but still use any !?=:; combination you can think of
i see
But even if you want custom per server prefixes you don't need it
Oh, one thing tho, if you are just starting, use the rewrite version of the library instead
pip install -U git+https://github.com/Rapptz/discord.py@rewrite#egg=discord.py[voice]
This command in your git enabled console would install rewrite version. It's just that 0.16 og the library is getting really outdated
thxxx
Also if you have any questions then you are more likely to find an answer in d.py server: https://discord.gg/r3sSKJJ
damn dude i really appreciate it
well i want to do another one question you know i can find code for music bot
@neon swift
Do I look like google????????????
haha and of course not just asking you why I have been looking and those I found did not work.
But I've tried and made both my own and the struggle, of course
and I said if you had someone and you could give it to me
@earnest phoenix rule 7a in #rules-and-info
any idea how I can create an older version of a file using git?
For example create a copy of a file 2 commits ago. How would I do that? (fixed
)
I need help with a bot I'm making. I'm having trouble figuring out a way to connect the bot, which is coded in C#, to the database I'm using, which is MariaDB (MySQL). Does anyone have experience with this particular setup? I've been searching the internet for answers and I've been coming up empty-handed.
take your time, I literally have a mountain of time on my hands.
:/
@ruby dust sorry my friend
what issues are you having exactly? @shy oak - I don't have experience with c# discord bot but I use mariadb as well in node, so if its not a c# related issue I might be able to help
it is a C# related issue. I can't get the connection object to work correctly.
ah I see, then better wait for someone who codes their bot with c# and uses mysql to give you a hand ;p
I have all the time in the world... 
:S
@earnest phoenix What Library are you using?
discord.js
node filename.js
Okay, assuming your code works, you can start it using a console with the node command
^
If you want it online and still use your terminal you can use forever. Just install npm install forever then forever start filename.js
(If you're computer/laptop turns off the bot will turn off too)
Pm2 also works. I'm using that
yeah, sure... completely gloss over my question... it's not like I need help or anything... ;;-;; 
I don't know c#
@shy oak some people won't be able to answer your question, there is nothing you can do about it. we're not going to freeze the channel until someone answers your question.
I know that.
then there is absolutely zero need for a response like this https://remindmebot.is-over.party/330314.png
I have been trying to work this thing out for a month and nobody's been able to help me yet, so I'm a little desperate at this point.
being desperate doesn't excuse your behaviour

if you're that desperate ask on a help forum where your question won't get buried
A month? Google is a better option at this point.
I tried that. nothing came up.
You also gotta take in not a lot of people in here are good with C#
discord.ExecuteAndWait(async () =>
{
await discord.Connect("TokenCode", TokenType.Bot);
});``` Is this the issue?
That’s be cool if there were different channels for different libraries.
no, it's not. I need a way to connect my bot's code to the Database that I have set up using MySQL.
I'm in the DiscordJS server because mines TS.
It's p big lol
Just joined
tell me if im wrong. Trying to get votes data. I do http request with my token then get data as json and parse?
Context please?
@shy oak Read this thoroughly https://dev.mysql.com/doc/visual-studio/en/visual-studio-making-a-connection.html
ya have a C# refrence for that...?
you can do a php connection and request data if that is easier for you
but both are easy
Google does wonders.
^ this fr
visual studio is mostly developed for C# if you're not aware
Oh? I've only seen people use it for C#
nope c++ is game changer on vs
I don't develop on windows so my C++ is all VSC
help
Please stop spamming that everywhere
i need my bot on my server
Invite it.
@glad charm have you ever did webhook request for who voted?
who voted? I guess not.
but seriously i need a sulotion
Do you not have the invite link to your bot?
Microsoft Visual Studio hosts various coding languages; including Visual Basic, C++, C#, Javascript and other similar languages.
https://discordapp.com/oauth2/authorize?client_id=yourbotsclientidgoeshere&scope=bot&permissions=0
it works!!!!!
Yeah
but its offline and says my application
Well you have to run the code for it to be online
how\
Well what did you develop the bot in?
github
🤔
we mean programming language
10/10
oh jeez
Lol
Github is my favorite library
did you develop the bot?
(code it)
stole it from github
yup
what programming language?
Html
java
and html
That's the first time I've seen someone make a bot with Java
Lul
Well, say they did
is there even a library for java?
I perfer scratch
Examples?
rythm
then discord py
I could, but I'm on a 4 year old phone
then jda
You know life's good when going to #announcements crashes discord
im on a 2 year phone that was 80$ when i got it
Doesn't crash my android
wait 3 years now
👌
Mine was low end when I got it as well, and it's Android as well
Android L ftw
ew LoliPop
get out jellybean
i use Oreo
I have no idea what version of Android I use, it last updated in 2016
no im not rooting my s9
ew
i can use a custom rom on my nexus
Idk if my phone could Handel the latest Android
yes i know what android N is
I have android 4.4.4 👌
apparently samsung made it pretty hard to install a custom rom on the s9
so im stuck with touchwiz
you guys 👀
well, that Stack Overflow page didn't help at all, since it was over 4 years old.
I just need help figuring out this database connection...
Age doesn't matterm 9/10 for me lol.
I need help with a Discord bot I'm making. I'm having trouble figuring out a way to connect the bot, coded in C#, to the database I'm using, which is MariaDB (simply a fork of MySQL). Does anyone have experience with this particular setup? I've been searching the internet for answers and I've been coming up empty-handed. Either the code is outdated or it fails entirely.
did you try this? https://stackoverflow.com/questions/44719432/querying-a-mariadb-database-with-c-sharp
if you cant find anything for mariadb, search for mysql. they both have 99% identical apis
I know that. It's just that the Libraries for the MySQL .NET packages were updated just a few days ago.
nothing works anymore :/
not even the Developer Guide for MySQL.
inb4 it's not a sql issue
if it doesn't work how about rolling back to a previous version
Anyone here with knowledge about a bot account with multiple receiver bots in the background? Like
One Bot thats check for commands, (Python)
Second posting RSS Feed stuff (Python)
Third doing other stuff (Go)
only theoretical knowledge
00:41] pawadox: multiple receiver bots?
you have 1 bot account that is used from 3 scripts (2python, 1 go ... so it is not 3x times the same, it is other stuff) in the background
your bot can login from multiple places at once, so you can have 3 connections
you basically want to micro-service your bot don't you?
but that will triple the data you're receiving from discord
you can have one bot that listens and passes stuff to other bots
00:42] Tim: but that will triple the data you're receiving from discord
right ... but i dont think thats a huge drawback
other than that its as simple as running 3 bots
using the same token to login
unless you wanna pipe data between them
yes
and know i'm would check if there is any big drawback, like getting banned or so
when you gotta update your VM instance for your bot and you're worried they're gonna try and review during down time
😱
im not sure about getting banned
well there's a lot of drawbacks actually
as far as i know it will just identify three times
thus you will reach the identify ratelimit 3 times faster
there is a identify ratelimit
the usual way is to only have one application connected to the gateway
lul never got it
then this application transmit it to the other services
it's 1000 identify/24h
each shard count as identify too
00:46] pawadox: then this application transmit it to the other services
but that would be a big drawback
the time between sharing is not small
why dont you just pack the 3 scripts into one?
unless you host your services on different servers each far away from each others
00:47] Tim: why dont you just pack the 3 scripts into one?
2 different languages + 1 script is blocking and that the async version is slow like hell
00:47] pawadox: sharing it would pretty much be instantaneous
but you can't share the full message obj between the bots, without time for copy
and other languages can't use the object, without getting it directly from discord again or?
if you're using different objects/libs, it might be tricky, yes
how would you pass the python message obj. into golang without needing time for reencoding into json and stuff
you waste so much time between this steps
well you don't really have the choice, it's either that way and it will scale, or your current way and it wont scale
transforming it into JSON and the other way around should be a matter of nanoseconds though
the problem is that the json object will be different from lib to lib
unless you're accessing the discord api directly
plus if you convert to json, you lose the api functions/methods
ye at this point you would usually don't use a lib
at this point yeah, you dont really have a choice besides rewriting everything into a single bot/lang/lib
well after all you're trying to use two different languages, you'll have to drop the simplicity
keep doing what you're doing, you got plenty of space left with 1000 logins per day
plus you can reload parts of your bot that way, without having to use command handlers lmao
1000 bots incoming
and split them into different hosts
as long that every bot only connects 1 time per day, everything should fine
true, but you should still think about it, as there will be a point where your system will break
tbh his system is actually quite scalable
why should it break? can you give me a example?
the only problem is literally triple the bandwidth and triple the resource usage
ye that's not quite scalable lul
and triple the resource usage
and the instances are not blocking each other
so it will be idling most of the time
ye that's not quite scalable lul
thats where i'm not so sure about
how big is your bot
when we think about python ... python is a shit language, you can't really multithread it without starting a new thread
so for python this is scalable like hell
thats why there is sharding
you just start own instances of the bot
sharding forces you to multithread regardless
that's where internal sharding comes into action and you don't multithread 
how big is your bot
not big, 1 server with 1k ?
nice
oh lmfao
it's just a private server, thats needs some functions
then you dont need to worry about anything
oh then you don't care at all about the identify ratelimit lmfao
but still i wont risk breaking api rules ... so thats why i ask here
i mean, im on almomst 300 servers with a single core and 600mb ram
ayyy
GCP?
google compute engine
Google Cloud platform
ye mine's on 3k servers and still use ~20% of the single core and 500mb ram
RMB got up to 4150 servers on a single core and 500MB ram
nice
"got up to" rip rmb
that included an express API too
ohh you can use google ... nice
hehe @heady zinc
was a good meme until the end
which lib was rmb?
eris
ah
trying to make my bot live with new VM instance and i have to reinstall all these dependicies holy shit
im gonna switch to eris maybe if i get close to 2k
im on djs stable and i have a problem with memory allocation
i doubt it's worth it honestly
because it caches users and they come online
nice
so after like 3 days it goes from 100mb ram to almost 300mb
d.js master is good
it has a clear cache thing iirc
i need to implement it into my bot
ye
what i did to fix linux's out of memory thing was create a 1gb swap file lmao
not very performance-y but does the job
i mean d.js stable is really outdated
even though it's bad practice you should use master
but tbh im just too lazy to switch
i have a shit ton of work to do on another project, its a big pain to even think about switching libs at this point
FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal. rip this is only happening now
I made a new VM instance and now it's dying lol
Apparently a well known issue lol
No just pulled my repo and npm install'd
MHMHMHM I think the node version did change
I'll bork it and reinstall to 6
@glad charm judging by your profile picture is it safe to assume you're a man of culture as well?
Yes sir
Keep it up then dear sir 
I found a way to add playlist support to my "play music command":
https://hastebin.com/febimolefa.js
The code to allow playlists:
if (url.match(/^https?:\/\/(www.youtube.com|youtube.com)\/playlist(.*)$/)) {
const playlist = await youtube.getPlaylist(url);
const videos = await playlist.getVideos();
for (const video of Object.values(videos)) {
const video2 = await youtube.getVideoByID(video.id); // eslint-disable-line no-await-in-loop
await handleVideo(video2, msg, voiceChannel, true); // eslint-disable-line no-await-in-loop
}
return msg.channel.send(`✅ Playlist: **${playlist.title}** has been added to the queue!`);
}```
Im just unsure of where I should put it in my original play command code it so it works correctly...
dependencies work fine on laptop but VM instance cries and it won't work. Time to find another way to keep track of shit
package.json
im using discord.js and im making a server info command, when i added the owner to it with message.guild.owner, it gave me UnhandledPromiseRejectionWarning: TypeError: Converting circular structure to JSON
what did i do wrong?
oh srry
im sorry im new to coding kindaish, if i wanted it to say who the server owner is similar to how message.author works, how would i do that
thank you
np
that finally got it working thank you
It's fine but googling isn't helping me
nvm
?
This code won't increment the value, it won't even print the new user into the database, using TinyDB on Discord.py
@bot.command(pass_context=True)
async def cookie(ctx):
await bot.say("Yum")
if cookiedb.contains(Users.id == ctx.message.author.id):
cookiedb.update({'user': ctx.message.author.id, 'cookies': increment})
else:
cookiedb.insert({'user': ctx.message.author.id, 'cookies': 1})```
Yeah you are going to have to figure this out on your own, not sure if anyone here woud know TinyDB (whatever that is)
or start using big boy databases, like asyncpg and postgre
can any1 help me in api?
@Luca botinfo @frosty flax
it doesn't work here sorry
ok you have a long description
and there is allowed html
so you can paste <style> tag
https://discordbots.org/bot/464747957288435732
mine page is the best
@weak stone what api?
if its for the discord bot list api, you would have to go to #topgg-api and ask for help
@earnest phoenix what do you mean "how can I make the name"?
color-shifter
Oh, you want it to change color?
You alright there
Oh, you want your bot name to be a different color on the site?
yes
Ok, idk then
How should I do
css
could you tell me where to find the command
@knotty steeple could you tell me where to find the command
@earnest phoenix
in your bot edit page
long description
use html: <style> </style>
and css
Isn't this for certified bots only?
can anyone show me how to make the bot edit a embed
?
what do you guys use for databases
nodejs
can anyone anwser my question
Hello I'm Doing A discord Bot From Discord.js. How To Ban&Kick With Messages?
you dont just come here to ask for code ok @buoyant sleet
Any reason my bot would be crapping out on this code?
any errors
?
No
Nada
Nilch
also why are you coding on your phone?
Because I'm on vacation
hmm....
no clue if i cant see all the code XD
haft of it is cut off
Hold on, ill get a file
put it in a hastebin XD\
Can't I don't think. I can't cut and paste from the codeanywhere app
lol
im not downloading it
That's the best I can do
XD
do you know how to remove the code
waht code?
line above bot image
@earnest phoenix here
line above bot image
Css sucks ass dude sry. You should use a preprocessor like scss
Then compile it ofc
what is crapping out on your code exactly
Idk why but my bot keeps restarting
Pm2 errors somehow restarts the process and I see none of it
uh, perhaps it runs out of memory 
i mean it's a possibility but i highly doubt it's the case
Oh
do you check the full logs from pm2?
I use pm2 restart 12 && pm2 logs 12 when I restart the bot after adding smth new
Does that not give me the full logs?
it does, threre's nothing that makes sense in your logs?
No. Just my bots startup logging which just tells me when each command gets loaded into sqlite
it loads a few lines from history and then prints the logs live
Ye
ye so everytime you run the command your bot just restart and nothing else is logged? 
No every time I restart the bot it loads all the commands like 20 times through
And when I run the new command it literally does nothing
how does your command loader work
Same way https://anidiots.guide command loader does
hey how would you make your bot edit its embed
New embed object
soo at this point, i can only think of adding logs to the console at every step of your command
like the bot edits the embed
to see exactly where it borks
Bork!
can anyone give me an example of it
?
Anything wrong with these two lines? Cuz I think I might have the dimensions off and that's why it's hiccuping.
The dimensions of the whole image are 500px by 250px
are you using js?
yes that is js
I'm messing around with Oauth2 atm, so I'm trying to amke a simple API call using cURL. I can access the API and get results using a bot token, but I keep getting '401 : Unauthorized' errors with my bearer token, even though I have the token. Any ideas ? My code :
$membersEndpoint = $domain . "/guilds/guildID/members/" . $user->getId();
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $membersEndpoint,
CURLOPT_HTTPHEADER => array('Authorization: Bearer TOKEN'),
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_FOLLOWLOCATION => 1,
CURLOPT_SSL_VERIFYPEER => 0,
));
$output = curl_exec($curl);
curl_close($curl);
I'd rather use something not related to my bot to make these API calls if i can
Ye @earnest phoenix
?>
I do use js
ah
Canvas to be exact
i dont know
With d.js and snek
need help with how to edit a embed
make the bot edit it
Use a new embed object
And edit the old msg with it
i need an example XD im not that experienced with embed
not that im not expreienced its that im having trouble making it XD
ayy its Tom XD
const embed = { title: 'example' };
const editmsg = await msg.channel.send({ embed: embed });
// do whatever you need
embed.title = 'something else';
editmsg.edit({ embed: embed });
something like that
ahh ty
not 100% sure if .edit() is correct for d.js but its probs something like that
ill try it
im not really a dev i just use discord bot maker uhhh bye
Uh?
Yeah bye @bold girder






