Skip to content

Commit

Permalink
v1.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus-Rost committed Jan 6, 2019
1 parent 6409ab0 commit a315772
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<a href="https://discordbots.org/bot/461189216198590464"><img align="right" src="https://discordbots.org/api/widget/461189216198590464.svg" alt="Wiki-Bot"></a>
**Wiki-Bot** is a bot for [Discord](https://discordapp.com/) with the purpose to easily link to [Gamepedia wikis](https://www.gamepedia.com/).
<br>He resolves redirects and follows interwiki links.
<br>**Wiki-Bot** has translations for English, German, French, Polish and Brazilian Portuguese.
<br>**Wiki-Bot** has translations for English, German, French, Polish, Turkish and Brazilian Portuguese.

**Wiki-Bot is not affiliated with Curse/Gamepedia and is an unofficial tool!**

Expand Down
16 changes: 7 additions & 9 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,9 @@ function cmd_settings(lang, msg, args, line) {
}
if ( args.length ) {
if ( args[0] ) args[0] = args[0].toLowerCase();
var regex = null;
if ( args[1] ) {
args[1] = args.slice(1).join(' ').toLowerCase();
regex = args[1].match( /^(?:(?:https?:)?\/\/)?([a-z\d-]{1,30})\.gamepedia\.com/ );
args[1] = args.slice(1).join(' ').toLowerCase().replace( /^<(.*)>$/, '$1' );
if ( args[1] && ( args[0] == 'wiki' || args[0] == 'channel' ) ) {
var regex = args[1].match( /^(?:(?:https?:)?\/\/)?([a-z\d-]{1,30})\.gamepedia\.com/ );
}
var langs = '\n' + lang.settings.langhelp.replace( '%s', process.env.prefix + ' settings lang' ) + ' `' + i18n.allLangs[1].join(', ') + '`';
var wikis = '\n' + lang.settings.wikihelp.replace( '%s', process.env.prefix + ' settings wiki' );
Expand Down Expand Up @@ -1436,17 +1435,16 @@ client.on( 'voiceStateUpdate', (oldm, newm) => {

client.on( 'guildCreate', guild => {
console.log( '- Ich wurde zu einem Server hinzugefügt.' );
client.fetchUser(process.env.owner).then( owner => owner.sendMsg( 'Ich wurde zu einem Server hinzugefügt:\n"' + guild.toString() + '" von ' + guild.owner.toString() + ' mit ' + guild.memberCount + ' Mitgliedern.\n(' + guild.id + ')' ), log_error );
} );

client.on( 'guildDelete', guild => {
console.log( '- Ich wurde von einem Server entfernt.' );
client.fetchUser(process.env.owner).then( owner => owner.sendMsg( 'Ich wurde von einem Server entfernt:\n"' + guild.toString() + '" von ' + guild.owner.toString() + ' mit ' + guild.memberCount + ' Mitgliedern.\n(' + guild.id + ')' ), log_error );

if ( !guild.available ) {
console.log( '- Dieser Server ist nicht erreichbar.' );
return;
}
else if ( settings == defaultSettings ) {

if ( settings == defaultSettings ) {
console.log( '- Fehler beim Erhalten bestehender Einstellungen.' );
}
else {
Expand Down Expand Up @@ -1475,7 +1473,7 @@ client.on( 'guildDelete', guild => {
}
else {
settings = Object.assign({}, temp_settings);
console.log( '- Einstellungen erfolgreich aktualisiert.' );
console.log( '- Einstellungen erfolgreich entfernt.' );
}
} );
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "discord-wiki-bot",
"version": "1.1.2",
"version": "1.1.3",
"description": "Wiki-Bot is a bot for Discord with the purpose to easily link to Gamepedia wikis. He resolves redirects and follows interwiki links.",
"main": "main.js",
"scripts": {
Expand Down

0 comments on commit a315772

Please sign in to comment.