#development
1 messages · Page 607 of 1

he has now switched on, but he does not answer all commands
Can you show me your code
Taki
I have
which library?
Your bot is online but not responding to commands. Did you check if it has proper perms?
try showing your code
no command has been running since 12 and it was working before
my bot is createt on dbm
when I run a bot from my computer everything is ok, only when I turn on the bot with vps is not ok
Discord Bot Maker?
I highly recommend you learn how to use one of Discord's many libraries
Or join the dbm support server
...
I don't think anyone here uses DBM to make bots unfortunately. You'll be better off joining their support server
Yeh
Console.ReadLine() returns a string afaik
or a buffer
either one of those
yeah it returns a string
you need to convert it to an integer first
Ye? I see it
it's returned as a string
because the user can input other characters than numbers
you'd use int.TryParse to see if it's a valid number
does anyone here use pm2? how can i execute a command to an already running process?
so basically i did pm2 start "java -jar server.jar" --name something
and i wanna execute commands in that process
or are there any pm2 alternatives that let me do that?
no
if your distro uses systemd (eg ubuntu, debian), you can try this https://unix.stackexchange.com/questions/453998/systemd-connect-to-stdin-stdout-after-service-has-started
systemd should be able to do everything pm2 does
ah, and i just connect to the process with conspy 20?
you'd change 20 to the tty you're using
lul
that happens when you use ids to calculate ping
Clock drift refers to several related phenomena where a clock does not run at exactly the same rate as a reference clock. That is, after some time the clock "drifts apart" or gradually desynchronizes from the other clock i.e. the crystal-based clocks used in computers, like a...
*yardım
Do people suggest pm2 or systemd
For what
They can be used together as well
Usually I would recommend using Kubernetes or other orchestration tools and Docker to manage production bcode
I suggest standard node. But that's me. Pm2 is nice and let's you to interact with the application through a website. But the problem I have had, and I have a feeling others had is that sometimes your bot will crash when added to pm2, this has happened to me every time. I never really worked with systemd, so cant tell you much about that one
Node.js is going to be alot easier to deal with. Nodemon is also another good one to choose, but if your ide autosaves, then I wouldn't recommend nodemon since it restarts Everytime it senses that a file has saved.
anyone else having issues with node.js?
an issue with node.js could be extremely broad
i'm not sure what you're trying to do
Well read the errors
i have.... i have tried to look those up and they still do not work...
no matter what i try i get the same errers
Discord.js needs to have one of those dependencies to be installed I believe
i just tryed to install npm install bufferutil --save-optional and i got the same error
Do opusscript and node-opus
nope same errors for both
What does the errors look like when trying to install opusscript?
hmm it says npm ERR code 1
It won't let him install d.js cause he doesn't have one of the listed dependencies installed, something like that
thebeat@1.0.0 /home/TheBeat/thebeat
├── UNMET PEER DEPENDENCY bufferutil@4.0.1
├── UNMET PEER DEPENDENCY erlpack@earnest phoenixapp/erlpack
├── UNMET PEER DEPENDENCY libsodium-wrappers@^0.7.3
├─┬ UNMET PEER DEPENDENCY node-opus@0.3.1
│ ├── bindings@1.2.1
│ ├── commander@2.20.0
│ ├── nan@2.13.2
│ └─┬ ogg-packet@1.0.1
│ └─┬ ref-struct@1.1.0
│ └── ref@1.3.5
├── UNMET PEER DEPENDENCY opusscript@^0.0.6
├── UNMET PEER DEPENDENCY sodium@^2.0.3
└── UNMET PEER DEPENDENCY uws@^9.14.0
So he is trying to install it when it's already installed?
you can ignore those
it installed d.js, then listed those optional dependencies that aren't installed
so i don't actually need those?
i'm working on making a bot right now so i just want to make sure
oh
Do you ffmpeg installed?
Ok
thebeat@1.0.0 /home/TheBeat/thebeat
├── UNMET PEER DEPENDENCY bufferutil@4.0.1
├── UNMET PEER DEPENDENCY erlpack@earnest phoenixapp/erlpack
├─┬ ffmpeg@0.0.4
│ └── when@3.7.8
├── UNMET PEER DEPENDENCY libsodium-wrappers@^0.7.3
├── UNMET PEER DEPENDENCY node-opus@0.3.1 extraneous
├── UNMET PEER DEPENDENCY opusscript@^0.0.6
├── UNMET PEER DEPENDENCY sodium@^2.0.3
└── UNMET PEER DEPENDENCY uws@^9.14.0
i just tried to install node-opus but its saying it's still not in stalled
ok i got opusscript to go
Have you checked in your node_modules if you have opus there?
Ok
npm says it installed it but it don't show up that its installed
One message removed from a suspended account.
One message removed from a suspended account.
What does your json files look like?
One message removed from a suspended account.
There should be a file already made for you calledpackage.json it will be lower case, look at that file
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
From my understanding of the package.json file is that it is used to store all of your packages and dependencies. Not where you put stuff for your bot. I believe it's complaining about that the keys you have in it is not what is supposed to be there. It's talking about the beginning
What ide are you using?
I wouldn't use notepad at all, notepad++ is a different story
@bold oxide help
Can't use bots here
ok so i've fixed my npm... apparently it wasn't updated to the right npm and i had to update it
now all is working
everything is installed 😃
ok i have installed discord-irc but everytime i go to use it i get -bash: discord-irc: command not found
Linker@1.0.0 /home/Weldon/Bots
└── discord-irc@2.7.0
npm WARN Linker@1.0.0 No repository field.
npm WARN Linker@1.0.0 No license field.
[Weldon@thunder Bots]$ discord-irc --config linker.json
-bash: discord-irc: command not found
ok nevermind got hat
lol
that
Code it yourself, we don't spoonfeed here
Hello, I would like to know how to add a widget on my bot with (.setImage("LINK HERE")I did this, do its not work.
please tell us which language you're using, which library you're using and show us the code you tried
Uh, I am using discord.py and for some reason my bot is REALLY lagging nowadays, with below 1% server resource usage. Like, I get a response 10 seconds after typing the command. It used to be fine earlier. My bot is in 770 guilds now tho.
Logs show nothing, testing bot works fine on my laptop
also this lag does not occur all the time, only 70% of the time
Hello, I created a command create prompt but it tell me: createInvite is not defined. How do I define it??
js ?
yes
@earnest phoenix
yes
console.log(inv.url)
})``` i think is that
edit ^
My coding is not the same wait
guild.defaultChannel.createInvite({
maxAge: 0
}).then(invite => {
message.channel.send(`**Lien permanent :** \n http:\//discord.gg/${invite.code}`);
}).catch(e => logger.error(e))
};
uh defaultChannel has been deleted
From discord.js
I withdraw it
My codage :
const Discord = require ("discord.js")
exports.run = (client, message) => {
let guild = message.guild;
message.delete();
if (!message.guild.member(message.author).hasPermission('CREATE_INSTANT_INVITE')) {
return message.reply('<565822552815960064> | Vous devez avoir la permission `CREATE_INVITE` pour effectuer cette commande.').catch(e => logger.error(e))
}
guild.defaultChannel.createInvite({
maxAge: 0
}).then(invite => {
message.channel.send(`**Lien permanent :** \n http:\//discord.gg/${invite.code}`);
}).catch(e => logger.error(e))
};
module.exports.help = {
name: 'createinvite'
};
use guild.channels.random.createInvite({ maxAge: 0 }).then(invite => { message.channel.send(`**Lien permanent :** \n http:\//discord.gg/${invite.code}`); }).catch(e => logger.error(e)) };
ok
ah mais attend
t'es fr
Je viens de remarquer en envoyant le code
ah bah oui
mdrr
toi aussi ?
oui
pareil
je reviens dans 5 minutes
euh 30
ok
Or create the invite for the channel the command was used in?
Would make more sense, no?
I'm hosting my bot on my old phone with 2gb of RAM and it works great and is almost free xd
Hello, how can I send a private message to the person who adds my bot I put this: guild.owner.send
But whoever adds it is not necessarily the owner
You can't know who added the bot unless you're using OAuth to have users authorize afaik
Ok thx
And the use of richpresence to put a thing that is done like: Develop your bot with a large image etc is it allowed?
Anyone know how I can represent 18446744073709551616 as 18446744073709551616 in javascript?
It doesn't work like normal https://img.ictman.tk/ONWnbYb2
Yes but if you'll have links and stuff on it, some servers might ban you as they could see it as advertising @lofty hamlet
@fair minnow use strings?
I need to do maths on it :/
oof
var result = minimum + (number / 18446744073709551616) * (maximum - minimum + 1)
It's part of an algorithm for provably random number generation
18446744073709551616 = 16^16
The only 2 solutions I can see is use a smaller number (which I'd rather not do) or use a js library like math.js
member count not updating in discord server list website
its currently 232569 members
Are you waiting more than 6 hours? @fathom mesa
@earnest phoenix i add the server on website on match 10th
Yes
i checked today the member count didnt update
But when the server had 217500 members?
yes
More than 6h aho?
wait should i give to powers to the @pliant gorge in order to work that member count?
@late hill by discord this is allowed ?
Yes
anyone pinged?
Ok thanks you
Just don't spam change it
@late hill me ?
Yes
Of ?
I do not have to spam what?
@late hill 🤔
I think I understand, I have to change often if I understood correctly
Apr 22 18:20:48 megumin run.sh[26256]: INFO:discord.voice_client:Starting voice handshake...
Apr 22 18:20:49 megumin run.sh[26256]: INFO:discord.voice_client:Voice handshake complete. Endpoint found singapore456.discord.gg (IP: 103.126.138.58)
Apr 22 18:21:54 megumin run.sh[26256]: WARNING:discord.state:VOICE_STATE_UPDATE referencing an unknown member ID: 508156862328340490. Discarding.
...
Apr 22 18:23:43 megumin run.sh[26256]: File "/usr/lib/python3.7/asyncio/selector_events.py", line 494, in _sock_connect_cb
Apr 22 18:23:43 megumin run.sh[26256]: raise OSError(err, f'Connect call failed {address}')
Apr 22 18:23:43 megumin run.sh[26256]: TimeoutError: [Errno 110] Connect call failed ('103.126.138.58', 443)
Anyone else facing this?
One message removed from a suspended account.
It depends if you know how to code and how well
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
No language is better than other
Php its not java or javascript
@sage bobcat you would need to handle user input, and a database to save progress
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
why not learn and read the docs
1+1=2
@sage bobcat You could see if there's a tutorial online on how to make a bot. Then, when you feel ready, you can embellish it with your own stuff. That's how I learned.
public class Main {
public static void main(String[] args) throws LoginException {
String token = "TOKEN";
JDABuilder builder = new JDABuilder(AccountType.BOT);
builder.setToken(token);
builder.addEventListeners(new Citation());
builder.build();
}
}```
```Java
public class Citation extends ListenerAdapter {
public void onCitation(MessageReceivedEvent event){
event.getChannel().sendMessage("hello").queue();
}
}``` It won't say hello :(
@inner jewel it won't Override
bukkit x')
you need to override the right method for it to be called
ok i'll try it
onX(XEvent)
wtf duuuuuudeeeee
One message removed from a suspended account.
Just like making an other bot, expect you tell to do invites
if (message.guild) {
score = client.getScore.get(message.author.id, message.guild.id);
if (!score) {
score = { id: `${message.guild.id}-${message.author.id}`, user: message.author.id, guild: message.guild.id, points: 0, level: 1 }
}
score.points++;
const curLevel = Math.floor(0.07 * Math.sqrt(score.points));
if(score.level < curLevel) {
score.level++;
if(message.guild.id === "264445053596991498") return; // ------------------- Is this correct way to block level message here?
message.reply(`Your level is now! **${curLevel}**!`);
}
client.setScore.run(score);
}
``` Check the comment!
put that under if (message.guild) {
but that will block every message in the server
soo i'm kinda stuck
if (message.guild && message.guild.id != "264445053596991498") { }
whaat?
remplace if (message.guild) { by ^
why tho
lient.on('message', message => {
if (message.author.bot) return;
/*client.channels.get('568027128470437888').send(
message.author.username.toString()
+ " :: " +
message.content.toString()
+ " :: Userid ::" +
"<@" + message.author.id + ">"
)
*/
let score;
if (message.guild) {
score = client.getScore.get(message.author.id, message.guild.id);
if (!score) {
score = { id: `${message.guild.id}-${message.author.id}`, user: message.author.id, guild: message.guild.id, points: 0, level: 1 }
}
score.points++;
const curLevel = Math.floor(0.07 * Math.sqrt(score.points));
if(score.level < curLevel) {
score.level++;
if(message.guild.id === "264445053596991498") return;
message.reply(`Your level is now! **${curLevel}**!`);
}
client.setScore.run(score);
}
idk if i should
@earnest phoenix, What are you trying to do?
well
What's up?
here one sec
for only this server
score = client.getScore.get(message.author.id, message.guild.id);
if (!score) {
score = { id: `${message.guild.id}-${message.author.id}`, user: message.author.id, guild: message.guild.id, points: 0, level: 1 }
}
score.points++;
const curLevel = Math.floor(0.07 * Math.sqrt(score.points));
if(score.level < curLevel) {
score.level++;
if(message.guild.id === "264445053596991498") return; // ------------------- Is this correct way to block level message here?
message.reply(`Your level is now! **${curLevel}**!`);
}
client.setScore.run(score);
}```
and so it doesn't block every other server
;)
the one i sent will work
wtff
one sec @earnest phoenix
It will only run on this server
The code in that
it will only run on this server
EXACTLY what I don't want
idk
there's != so it'll work when server id is not "264445053596991498"
if (message.guild {
if (message.guild.id === 'ID') return;
}```
thats pretty unnecessary tho
😇
thanks
i used if (message.guild && message.guild.id != "264445053596991498") { in the end
You don't need to check for message.guild, you know it's in a guild
Any want to help in #topgg-api
that's why the check was there in the first place
I do use dm's to make a special verify system for only my friend's server
But that's for one command
You specifically told it to be in dms for the command, every other command is default which is by the server
read
trying to create a loop
the error's told on the console
Client.on('ready', async () => {
function
my code
Await is an asynchronous function, it is only valid in asynchronous methods/functions
You have to give more than one line my friend
function sleep(ms) {
bot.user.setActivity(`you everyday.`, {type : 'WATCHING'});
await sleep(1000);
bot.user.setActivity(`22 everyday.`, {type : 'WATCHING'});
await sleep(1000);
bot.user.setActivity(`232131232 everyday.`, {type : 'WATCHING'});
return new Promise(resolve => setTimeout(resolve(), ms));
}
})```
async function sleep(ms) {
^^^^^^
unless he defined that
Client*
Client.on('ready', async () => {
async function sleep(ms) {
Client.user.setActivity(`you everyday.`, {type : 'WATCHING'});
await sleep(1000);
Client.user.setActivity(`22 everyday.`, {type : 'WATCHING'});
await sleep(1000);
Client.user.setActivity(`232131232 everyday.`, {type : 'WATCHING'});
return new Promise(resolve => setTimeout(resolve(), ms));
}
})```
türk varmı türk
still
hold on
xd
checked before you send my friend
You don't call the function
And if you did
It would be fucked
Because it endlessly keeps calling itself
what name did you define new Discord.Client(); as
Client
ew
still no activity showing
wait
Client.user.setActivity()
setTimeout(game2, 10000);
};
function game2(){
Client.user.setActivity()
setTimeout(game1, 10000);
};
Client.on("ready", () => {
setTimeout(game1, 10000);
});```
edit ^
edited bro
i'm french
||cough cough prefect time to plug my botcough cough||
Ok
how would i remove focus from an input field with javascript?
i have a regular <input type="text" autofocus> field
i tried document.getElementById('inputfieldid').blur() but that doenst do anything
but .blur() is the answer
hi
but it doesnt work
mate i know
let me get the file
upon pressing escape it should unfocus the input field
but it doesnt
whats your id?
putting a console.log() in the Mousetrap callback works tho, so thats not the problem
i sent the file
i can't look at it cause i am on a chromebook right now
ow in the version i sent im still using jquery
but from what you sent about the .blur, what is the id of the field?
the id is not the problem
but it is
.getElementById() is going to search by the element ID, in this case your id is searchfield
yes
and thats what i have in the code
actually, hold up
oh wiat
i just realized what the issue is
i used Mousetrap.bind instead of Mousetrap.bindGlobal
ok now its working
oofers
Hello, I coded a music bot but when I made the play command with a YouTube link, the. BOT joins the vocal salon and leaves immediately. The worries come from the:
const dispatcher = serverQueue.connection.playStream(ytdl(song.url))
.on('end', reason => {
message.channel.send('``La musique est terminée.``');
if (reason === 'Stream is not generating quickly enough.') console.log('Fin de la musique.');
else console.log(reason);
serverQueue.songs.shift();
play(guild, serverQueue.songs[0]);
})
.on('error', error => console.error(error));
dispatcher.setVolumeLogarithmic(serverQueue.volume / 5);
serverQueue.textChannel.send(`?? Début de la musique : **${song.title}**`);
}
});
How i can pick a random personn with the reactions of a message ?
.random()
?
Si jamais tu es Francais. Dit le
ah ok
Il est francais ahhh
Plus simple d'un coup

This is a english channel
Speak in english :/
Fr
bah développement
channel
Toute les langues
Tkt
donc tu peut
Ya que dans general que tu peux pas
Jparle h24 fr ici
I'm not french dude
@earnest phoenix French in #memes-and-media and commands in #commands / #265156322012561408
Je crois
You too @earnest phoenix
Yep ne se dit pas en anglais
You can speak english ?
Yes
dats not english
Yes
@west spoke If the French are not allowed to speak French. How do they do it? Open-minded in term of language ! not just English.
Yes but i speak french because the people are french
Dude its general
French are allowed in development
Ask to a mod
@west spoke Leave now.
Stop and speak english dude
^
Some people dont
afaik, #memes-and-media is the only channel for other languages
Thank you.
everything else is mostly english-only, aside from some small tips here and there
rule 6
Client.user.setActivity()
setTimeout(game2, 10000);
};
function game2(){
Client.user.setActivity()
setTimeout(game1, 10000);
};
Client.on("ready", () => {
setTimeout(game1, 10000);
});```
Still can't fix
ok but you could just use recursion
@pallid zinc dude
also what the fuck
What
your () are empty
And what is the problem?
No console err

But not showing the activity

active?

elaborate
Ok let's not spam haha
@pallid zinc bot takes time to show activity
Do you have restart your bot?
tbf you are changing status every 10 seconds
thats borderline api abuse
change it to something like a minute
The max is 5 times per minutes
Oofers
Max is 5 times a minute
And put off your bot for 3m and restart it after
New Error:
CustomClient.js: https://hasteb.in/lexewori.js
ready.js: https://hasteb.in/pilufevi.js ```sh
yarn run v1.15.2
$ node dist/index.js
/Users/sinistercyborg/Workspace/Bot/dist/structures/CustomClient.js:33
this.on(name, (...args) => event.exec(args));
^
TypeError: event.exec is not a function
at FeliciaClient.on.args (/Users/sinistercyborg/Workspace/Bot/dist/structures/CustomClient.js:33:46)
at FeliciaClient.emit (events.js:193:13)
at WebSocketManager.triggerReady (/Users/sinistercyborg/Workspace/Bot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:442:17)
at WebSocketManager.checkReady (/Users/sinistercyborg/Workspace/Bot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:411:61)
at Object.module.exports [as READY] (/Users/sinistercyborg/Workspace/Bot/node_modules/discord.js/src/client/websocket/handlers/READY.js:17:13)
at WebSocketManager.handlePacket (/Users/sinistercyborg/Workspace/Bot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:390:31)
at WebSocketShard.onPacket (/Users/sinistercyborg/Workspace/Bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:398:22)
at WebSocketShard.onMessage (/Users/sinistercyborg/Workspace/Bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:264:10)
at WebSocket.onMessage (/Users/sinistercyborg/Workspace/Bot/node_modules/ws/lib/event-target.js:120:16)
at WebSocket.emit (events.js:193:13)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.```
the event you are calling doesnt have exec as function
double check how you load and your event files
That's what I need help with
thats your problem I answered it
Im not sure what "event" cause your stacktrace just says there
static exec() might work
actually
nvm it won't
you need to call new on the events
new (require(theevent))(client)
CustomClient.js line 40 @inner jewel
I think the TypeScript file might be easier on ur eyes:
CustomClient.ts: https://hasteb.in/awurokun.js
do something like this
fs.readdir your files
require it then call new on it
after calling new on it put it on function
That's what I think I'm doing
thats what you need to do since its class based
what's ready.ts
if its a function, you can get away without doing new
// ready.ts
import { Event, FeliciaClient } from "..";
export default class extends Event {
constructor(client: FeliciaClient) {
super(client);
}
exec() {
console.log(`${this.client.user!.username} has logged in, serving ${this.client.guilds.size} guilds.`);
}
};```
just do the same thing for events as you do for commands except bind your client
like
const event = require('./ready.js')
client.on(eventname, event.exec)
then on your event
exports.exec = async function () {}
where this is your client on event
ok
and do that dynamically for all files in your event folder with fs
functions like
async function stuff() {}
can inherit this without doing bind()
while
const stuff = async () => {}
needs .bind() so you can make your this as client on that function
async () => {} doens't have a this
you can bind this there
since bind creates a new function
but you woud be better of async function stuff () {}
less overhead
then thats sad
vs
normal function has this
arrow functions have the this from the enclosing scope
arrow functions dont override this if for exampe its inside a class
class C { something() { return () => console.log(this); } }
new C().something()() would print the C instance
which is the this value for the arrow function's enclosing scope
this is big overcomplicated in js tbh
i recommend the video series on egghead.io explaining this
just don't use this inside normal functions and you can avoid most problems
biggest issue is getting references to class instance functions (eg class C { callback() { ... } stuff() { setTimeout(this.callback, 10); } })
i just avoid this
how to allow to do-release-upgrade in command to not must send Y after 2 minutes?
^linux
Can you install canvas without using npm.
One message removed from a suspended account.
One message removed from a suspended account.
Idk in py
One message removed from a suspended account.
One message removed from a suspended account.
Why the hell is Python mentioned on that screenshot
Idk
because of node-opus
I can not read, thank you
node-opus depends on node-gyp which requires windows build tools and python in path
Run npm i windows-build-tools --production --vs2015 --add-python-to-PATH --global as admin, and restart terminal.
Restarting machine can also be required.
copied from d.js discord ^
How i can pick a random personn with the reactions of a message ?
Hum 🤔
what language do you use?
JS
array[Math.round(Math.random() * array.length)] should work
yes
spoonfeeding because i have no idea how to explain it
it just works
ok
dont ask me why
Hum what the name of the array ?
and not Math.round
otherwise small chance of out of range error
What wait
it depends on the array
I want a random reaction of this message
How i can PICK a user ?
array[Math.round(Math.random() * array.length)] ?
@lofty hamlet it's simple Math.random() is a random number from 0 to 1
if you multiply it by the array length it's a random number from 0 to the array.length
oh

you use master or stable version of d.js?
it should be ```js
message.reactions[reactionId].users
the message is the message the reactions are on
So
you first fetch the message
hey I dont know s about java
Oof
message.fetch("ID").reactions[reactionId].users ?
what is message.fetch("ID")
is there a way to do discord footers with OG?
But I just want to take a random person who has put a reaction to a message
@lofty hamlet you can also create a reaction collector
The message is already posted...
The message is already posted
What ?
I don't understand i want just want to take a random person who has put a reaction to a message (message already posted)
will this only be used once?
wqew,
Yes
if so then fetch the message, > .reactions.get("emoji id of the reaction") > .users > .random()
Basically the same thing as the giveaway bot reroll command
Ok thanks you
I go test and i recall you if he don't work
kk
One message removed from a suspended account.
Have you read the error?
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
reactions isnt a part of channel, its a part of the message
do var message = await client.channels.get(channel).fetchMessage("messageid")
message. etc what you had after channel
no
.fetchMessage is asynchronous
because it fetches from the api
client doesn't store messages
hello I was going to ask something was my boat but when I click invite an empty page I can do what I can do
i'm not sure i understood that sentence
my bot is showing up as online on discord but not online on the discord bot list
what is your bot?
It isnt here
i have the bot in a server that i made to test it
its showing up as online there
and the commands are working and stuff
its probably not that big a deal if its not showing up as online on discordbots.org but i just want to know why
@lofty hamlet whats wrong with it?
Scroll up
case "end": fonction.channellogs(message) var Fetchingchannel = args.slice(1).join(" "); var messagefetch = await bot.channels.get("493049997651345438").fetchMessage(Fetchingchannel) var Fetchvar = messagefetch.reactions.get("🙏").users.random() Fetchvar message.channel.send(Fetchvar) break;
Fetchvar is empty
can u console.log(messagefetch.reactions.get("emoji")
yea then do .users.random()
?
Yep
do it
random of undefined lmao
console.log(messagefetch.reactions.get("🙏".users.random()))
ur missing a )
My bad
random of undefined
No
console.log(messagefetch.reactions.get("🙏".users.random()))
I'm fucking !
a string has no users property
Ups 😂
One message removed from a suspended account.
One message removed from a suspended account.
undefined @slim heart
@sage bobcat user.tag}
One message removed from a suspended account.
@lofty hamlet copy paste it again please
@sage bobcat before, you're closing off the template like this ${thing}
console.log(messagefetch.reactions.get("🙏").users.random())
console.log( just the .users
then whatever message ur fetching has nobody whos reacted with that
hm
It's strange
https://img.jt3ch.net/f759f913.png cuz it works for me
One message removed from a suspended account.
It's so strange
fonction?
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
@sage bobcat that function is not asynchronous, you can try .send('blah').then(_ => {})
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Uh no
One message removed from a suspended account.
use an ide
One message removed from a suspended account.
What i send here are just examples. Youre not going to get far by just copypasting
It should be message.channel.send()
wad
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
put async before ur function
client.ping
no hes talking about bot latency not gateway latency
@sage bobcat https://javascript.info/async
One message removed from a suspended account.
One message removed from a suspended account.
or just do .then
Fireship made a great video on async/await
One message removed from a suspended account.
One message removed from a suspended account.
No
but then do what u need in {}
Your bot is going to send "client.ping" instead of its value
One message removed from a suspended account.
@mossy vine
One message removed from a suspended account.
One message removed from a suspended account.
dv dont look at what he said, that's the right idea but then put ur code in the {}
lol
Ok im probably waaay too tired to be able to help sorry
es oki
One message removed from a suspended account.
no
do the first message send, but now u have the new msg so u can interact with the <Message>.createdAt
and do math and what not, then edit the message or do whatever u want, and u have the ping
@slim heart
i love your brawlhalla Mirage Montage 🙂 its so good
oh wow, hi lol. i didnt think people would attach my discord to it but ty <3
np <3
One message removed from a suspended account.
One message removed from a suspended account.
Wot
One message removed from a suspended account.
LOL
One message removed from a suspended account.
lookup some javascript tutorials while ur at it please.
One message removed from a suspended account.
One message removed from a suspended account.
dont copy, actually learn it
One message removed from a suspended account.
its hard to learn how to swim if you jump off the deep end
One message removed from a suspended account.
The main point for the example is to give you a guildline on what you are meant to do
think of this: i can't just jump into a battlefield game and expect to be one hell of a sniper like ravic
i have to learn to be a hell of a sniper like him
Start with some simple tutorials , learn the verbiage, try to get the syntax down
ok this isnt really an issue im expecting to be able to fix on my own but on discordbots.org my bot isnt showing up as online even tho the bot itself is online and working like normal
just saying, maybe someone should look into that?
is this js only?
python too
What are some popular servces for hosting a bot?
an old pc in ur basement
fax
a fax would be free
Look at the pins
One message removed from a suspended account.
@sage bobcat I recommend resetting the token
Even if you delete people can still see it
One message removed from a suspended account.
One message removed from a suspended account.
r
IDblSelfBot me = await DblApi.GetMeAsync();``` keeps giving me ``` Could not load type 'Miki.Net.Http.HttpResponse`1' from assembly 'Miki.Net.Http, Version=1.5.0.0, Culture=neutral, PublicKeyToken=null'.```
One message removed from a suspended account.
@sage bobcat theres likely something else wrong with your code
a missing brace or quote or smth
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
not sure what you meant there^
I mean make a bot online
@earnest phoenix easiest would likely be Python and/or javascript
just google "python rewrite bot" since async is literally almost dead
ok
Let's not make Discord bots without knowing the basics of programming language
yeah
exactly
honestly, make a simple text-based game in python. So easy i could likely do it in my sleep xd
(node:20277) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 guildMemberUpdate listeners added. Use emitter.setMaxListeners() to increase limit
I'm using discord.js
I dont want to ignore it
would like to set max listeners to a known safe number
but process.setMaxListeners() doesn't do it for some reason
Is there a specific emitter that I have to call this method on?
why do you have 11 guildMemberUpdate listeners
if you only have one guildMemberUpdate event you should only have one listener
^ you should only have one listener per event
im trying to use attachments but its not working
oh wait nope got it
Any idea why I am getting this sometimes in my bot logs? My bot has nothing to do with voice chat and has no commands using voice channels.
Unknown User (VOICE_STATE_UPDATE User=********************** Gui ld=**********************).
can i change how my bot page looks like?
hi, I did small linux tool to update packages, apps and distro in one command, tested on ubuntu 19.04, maybe somebody would use
^ this isn't ad, I just share it
"i did small linux tool" "this isnt an ad, i just share it"
?
Do you know what an ad is?
One message removed from a suspended account.
var member= message.mentions.members.first();
let embed = new Discord.RichEmbed()
.setImage(message.member.avatarURL)
.setColor('#275BF0')
message.channel.send(embed)
}```
why
Assuming you are on stable - - > users have the avatarURL property members don't
how can you tell if a user is offline and not invisible
Standing next to them
that's like the point of the invisible status, people just don't want to be known that they are online
How long does it take to approve a bot?
thanks
@mossy vine what's the error in the config
tsconfig should something like ```json
{
"compilerOptions": {
/* Basic Options /
"target": "es6", / Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. /
"module": "commonjs", / Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. /
"outDir": "dist", / Redirect output structure to the directory. */
/* Strict Type-Checking Options */
"strict": true, /* Enable all strict type-checking options. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"resolveJsonModule": true
},
"include": [
"src"
]
}
yeah its exactly that minus the outDir
npm install @types/node
i did
update typescript
what's the error now lmao
same
hmm
index.ts cant find module ./config.json even tho its literally right next to it
import * as config from './config.json'
console.log(config.token)```
can you like send tsconfig.json
I thought json wasn't considered a module in ts, or am I wrong
{
"compilerOptions": {
/* Basic Options */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
"module": "es6", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
"strict": true, /* Enable all strict type-checking options. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"resolveJsonModule": true
}
}
dont mind the comments im too lazy to remove
idk it was default when i ran tsc --init

es6 is valid according to intellisense anyways
weird
its still complaining about resolveJsonModule and that it cant import the ./config.json module
auto changing status not working
let status = [
`DG.help`,
`over users can use me!`
]
setInterval(function() {
let status = status[Math.floor(Math.random() = status.lenght)];
Client.user.setActivity(status, {type: "WATCHING"});
}, 10000 )
})```
no err
ok there are so many issues with that
first
You spelled length wrong
and typed = instead of *
lol
what i have spelled worng
we told you lmao
can you read tho
Show updated code
wait trying new think
let statuses = [
`DG.help`,
`over users can use me!`
]
setInterval(function() {
let status = statuses[Math.floor(Math.random() = statuses.length)];
Client.user.setActivity(status, {type: "WATCHING"});
}, 30000 )
})```
fixed that status err
but new err
mate thats what im saying
boi im literally fucking telling you what to do it couldnt be simpler
I'm trying to load profile picture onto canvas but it returns image type is unsupported
I'm using the code off discord.js guide
done
did u put the image data into a canvas image @strange trout ?
const { body: buffer } = await snekfetch.get(message.author.displayAvatarURL());
const avatar = await Canvas.loadImage(buffer);
ctx.drawImage(avatar, 25, 0, 200, canvas.height);
`(node:1384) UnhandledPromiseRejectionWarning: Error: Unsupported image type
`
c thanks
- u should not use snekfetch cause its depriciated
async fetchAvatar(url) {
const result = await fetch(url);
if (result.ok) return result.buffer();
throw new Error('Failed to retrieve avatar.');
}
Used this aswell
Same error
what avatar type did u fetch?
message.author.displayAvatarURL()
:/ well try to do message.author.displayAvatarURL({format: "png"})
add the {format} thing
Works thanks
probs cause u been sending a webp format
@west raptor okay so i managed to fix the issue but now typescript compiles the import as import * as config from './config.json'; which isnt valid javascript according to node
