...
 
Commits (2)
......@@ -503,3 +503,6 @@ Les commandes >avatar et >icôneServeur donnent désormais un webp plutôt qu'un
Ajoute la commande >uptime.
Améliore la commande getMember.
Corrige les commandes >tg et >parle.
4.3.4 (09/02/2020)
Corrige la gestion des erreurs.
const util = require("./util.js"),
{ client } = require("./discordCore.js"),
{ auth, error, comm } = require("./util_Strun.js"),
{ client, auth } = require("./discordCore.js"),
{ error, comm } = require("./util_Strun.js"),
aides = [],
footer = { text: `🖕🏽 Strun
🎉 Les sympas
......
......@@ -438,6 +438,15 @@ client.on("message", msg => {
}
break;
case ">ping":
function c_ping(channel)
{
const then = Date.now();
channel.send().catch(error);
channel.send("Pong!").then(message => message.edit(`Pong! (${Date.now()-then}ms)`).catch(error), error);
}
c_ping(msg.channel);break;
case ">uptime":
if(checkMaster(msg.author))
msg.channel.send(uptime());
......
......@@ -13,25 +13,31 @@ const Discord = require("discord.js"),
]
});
var master;
module.exports = {
tagRegexp: tagRegexp,
checkMaster: checkMaster,
isAdmin: isAdmin,
jpeuxÉcrire: jpeuxÉcrire,
getUser: getUser,
getUsers: getUsers,
getMember: getMember,
getMembers: getMembers,
getChannel: getChannel,
getChannels: getChannels,
getServer: getServer,
getServers: getServers,
client: client,
exit: exit
tagRegexp,
auth,
getMaster: () => master,
checkMaster,
isAdmin,
jpeuxÉcrire,
getUser,
getUsers,
getMember,
getMembers,
getChannel,
getChannels,
getServer,
getServers,
client,
exit
}
module.exports.client.login(auth.token);
client.login(auth.token);
client.once("ready", () => module.exports.master = master = client.users.get(auth.master));
function exit()
......
{
"name": "strun_bah_couille",
"version": "4.3.3",
"version": "4.3.4",
"description": "Strun Bah Couille le Crisse-Barbe",
"main": "bot.js",
"repository": {
......
const util = require("./util.js"),
Discord = require("discord.js"),
{ client, isAdmin, jpeuxÉcrire, getChannel } = require("./discordCore.js"),
{ auth, comm, error } = require("./util_Strun.js"),
{ auth, client, isAdmin, jpeuxÉcrire, getChannel } = require("./discordCore.js"),
{ comm, error } = require("./util_Strun.js"),
servers = require("./savedData/DataSaver.class.js")("spoy", { channel: null, logEdits: true, logAdmins: false, ignoredChannels: [] }),
deleteIgnore = [];
let myId, master;
......
......@@ -26,7 +26,9 @@ const crisseBarbes = {
pasInsultes = ["très chèr·e", "minestre", "mia pauvre", "mia grand·e", "bibiche", "Paulo", "mamène"],
util = require("./util.js");
util = require("./util.js"),
getMaster = require("./discordCore.js").getMaster;
var respect;
......@@ -39,19 +41,18 @@ class StrunError extends Error {
}
module.exports = {
crisseBarbes: crisseBarbes,
checkCrisseBarbe: checkCrisseBarbe,
niceJSONDisplay: niceJSONDisplay,
parseParam: parseParam,
insulte: insulte,
insultePluriel: insultePluriel,
voyelles: voyelles,
delayedMsgDelete: delayedMsgDelete,
crisseBarbes,
checkCrisseBarbe,
niceJSONDisplay,
parseParam,
insulte,
insultePluriel,
voyelles,
delayedMsgDelete,
StrunError: StrunError,
error: error,
auth: require("./auth.json"),
error,
init: function(comm) {
init: function(comm, master) {
this.comm = comm;
delete this.init;
respect = require("./zouz.js").respect;
......@@ -152,6 +153,6 @@ function error(err)
msg += `\nMessage : ${err.message}`;
}
master.send(msg).catch(console.error);
getMaster().send(msg).catch(console.error);
console.error(err);
}
const util = require("./util.js"),
client = require("./discordCore.js").client,
{ auth, client } = require("./discordCore.js"),
{ StrunError, error, comm, auth } = require("./util_Strun.js"),
{ StrunError, error, comm } = require("./util_Strun.js"),
historique = new Map(),
......
const fs = require("fs"),
util = require("./util.js"),
{
client, checkMaster,
auth, client, checkMaster,
getUser, getUsers, getMember, getMembers
} = require("./discordCore.js"),
{
auth, comm, error,
comm, error,
insulte,
voyelles,
niceJSONDisplay
......