Giter Club home page Giter Club logo

gw2-discord-bot's People

Contributors

archomeda avatar darthmaim avatar frodesigns avatar gruntzy avatar nabrok avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gw2-discord-bot's Issues

Session timer never reset

Hello,
First of all thx for the bot it's really useful !

Only I have one little problem, the timer never reset, whenever i type !last sesion (me or one of my guild member) it always take the old timer.

On the exemple it's says I played for 172 minutes the 26/04/2021 whil I only played for 48 minutes, but It tool the 124 minutes from last time

Kind regards,
Joe

image_2021-04-26_151144

image_2021-04-26_151254

sor discord bot

Seems the bot is not working with the !last session command. fab bot though Nabrok <3

People that moved servers dont always have their role revoked

Hi Nabrok,

sorry for bothering you again. It has come to our attention that the gw2 world based roles arent always properly revoked when people move servers. I have checked the registered api key and the gw2 acc in question is not residing on the configured world id. I understand that the roles are checked when the Discord status of the linked discord account changes. The account we are checking right now is permanently in the busy status. We have not manually removed any roles to see what the bot does. The user has moved servers over 7 days ago. The bot has been restarted as a test 5 days ago. The user still has the old server roles assigned.

Warn user if the key doesn't have the correct permission(s)

Right now, if a key doesn't have the correct permission(s) for a specific command, it will either fail silently, or respond with an undefined value. It would be helpful if it responds with a message that it needs a key with more permissions.

Link command not applying role

Hello,

I'm trying to get the "link" command to add a role to the user, but it is not applying the role.

Console shows this error during the process:

(node:22586) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Forbidden
(node:22586) 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.

config snippet:

[world]
id = 1005 # world member has to be on to get in role, and default world for wvw stuffs.
role = "maguuma" # Name of the role, leave blank if you don't want this

Any thoughts or ideas?

Need to copy linked APIs from old server to new server

Nabrok,

We had a large server that had a couple hundred users with linked APIs. We had to migrate the server after a crash, but don't want everyone to have to relink if possible. Can you tell me how/where the linked APIs are stored so that I may retrieve them from the old HDD (which is fine) and put them into the new system?

Thanks,
M Yurkoskis

WvW rank 10000

Hi there, guessing you don't see many of these people, we have one and the bot does something odd when they query their rank (possibly to show off).
Bot will type then abort.
Log file states:
0|discord_ | (node:26015) DeprecationWarning: EvaluatedPermissions#hasPermission is deprecated, use Permissions#has instead 0|discord_ | Error reading account progression: Cannot read property 'title' of undefined

Cant enable world_roles on heroku

Hi Nabrok,

Im a nodejs/redis noob and Im trying to host your nice bot on heroku. I can run it, but not with the world_roles feature enabled. Any idea why? It reports the following when starting the app:

2018-08-14T17:21:31.764529+00:00 app[web.1]: events.js:183
2018-08-14T17:21:31.764532+00:00 app[web.1]: throw er; // Unhandled 'error' event
2018-08-14T17:21:31.764533+00:00 app[web.1]: ^
2018-08-14T17:21:31.764664+00:00 app[web.1]: at parseError (/app/node_modules/redis-parser/lib/parser.js:193:12)
2018-08-14T17:21:31.764661+00:00 app[web.1]: ReplyError: ERR unknown command 'config'
2018-08-14T17:21:31.764666+00:00 app[web.1]: at parseType (/app/node_modules/redis-parser/lib/parser.js:303:14)
2018-08-14T17:21:31.829161+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-08-14T17:21:31.829681+00:00 app[web.1]: npm ERR! errno 1
2018-08-14T17:21:31.831384+00:00 app[web.1]: npm ERR! [email protected] start: node discord_bot.js

Nothing I can really work with. If I remove the world_roles feature it works. The role is specified in the config.

Discord OAuth redirect error with web feature

Hi,
I am having issues with the "web" feature of the bot.

After accessing the bot's webserver and using the link to authenticate with discord, I get an error page after logging in discord.

The error displayed is the following : Mismatching redirect URI.

I have apache2 as a reverse proxy, the bot is listening on port 4001.
I also tried to use the bot with direct ip:port (no proxy), and it resulted in the same error from discord.

Here is my current config :

[web]
domain = "gw2bot.jesuisfan.tk"
protocol = "http"
port = "4001"
public_url = "http://gw2bot.jesuisfan.tk" # Use this for the public url if behind a proxy (such as nginx)

Any idea where the problem may come from ?

[Help] On Windows ?

Is there a way to use this bot on a Windows 10 OS ?

Like using Visual Studio Code or npm/NodeJs ?

Or a complete installation guide ?
Got this error with npm after make a copy of default.toml and rename it local.toml

1

"Bot is typing" Message persists until bot is restarted

On occasion Discord will say "<Bot_Name> is typing" and the bot never seems to get finished typing. Its hard to say what actually causes this event to occur, as our server has many many users with dozens of channels. When it occurs, a quick bot restart seems to make it right again, and the discord message ges away within moments of shutting the bot down.

Is there any advanced logging I can cat for you, or enable to more thoroughly characterize the issue?

Code doesn't work on windows or other os... what is wrong? can you make it compatable with windows please

#! /usr/bin/env nodejs
var
config = require('config'),
Discord = require('discord.js'),
gw2 = require('./lib/gw2'),
phrases = require('./lib/phrases')
;

var language = config.has('features.language') ? config.get('features.language') : "en";
var features = config.has('features.enabled') ? config.get('features.enabled').slice() : [];

gw2.setLanguage(language);

console.log('Use this link to add the bot to a discord server: https://discordapp.com/oauth2/authorize?client_id='+config.get('discord.clientid')+'&scope=bot&permissions=8');
var bot = new Discord.Client({ autoReconnect: true });
bot.setMaxListeners(Infinity);

if (features.indexOf("link") === -1) features.unshift("link");
features.forEach(feature => {
require('./features/'+feature)(bot);
});

bot.on("ready", function() {
console.log('bot ready');
});

bot.on("disconnected", function() {
console.log('disconnected');
});

bot.on("message", function(message) {
if (message.content.match(new RegExp('^!'+phrases.get("CORE_HELP")+'$', 'i'))) {
var help = features.map(f => phrases.get(f.toUpperCase()+"_HELP")).filter(f => !!f).join("\n\n").trim();
message.author.sendMessage("Commands\n"+help);
return;
}
});

var token = config.get('discord.token');
if (! token.match(/^Bot /)) token = 'Bot '+token;

bot.loginWithToken(token);

Unhandled "error" event causes bot service to crash

This just started happening once a day early in the morning. Bot runs fine, then crashed with the following outputs and stacktrace:

Jan 24 00:39:31 files npm[1022]: events.js:188
Jan 24 00:39:31 files npm[1022]:       throw err;
Jan 24 00:39:31 files npm[1022]:       ^
Jan 24 00:39:31 files npm[1022]: Error: Unhandled "error" event. ([object Object])
Jan 24 00:39:31 files npm[1022]:     at Client.emit (events.js:186:19)
Jan 24 00:39:31 files npm[1022]:     at WebSocketConnection.onError (/Drive1/Games/Discord_GW2_bot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:371:17)
Jan 24 00:39:31 files npm[1022]:     at WebSocket.onError (/Drive1/Games/Discord_GW2_bot/node_modules/ws/lib/event-target.js:128:16)
Jan 24 00:39:31 files npm[1022]:     at emitOne (events.js:116:13)
Jan 24 00:39:31 files npm[1022]:     at WebSocket.emit (events.js:211:7)
Jan 24 00:39:31 files npm[1022]:     at WebSocket.finalize (/Drive1/Games/Discord_GW2_bot/node_modules/ws/lib/websocket.js:190:41)
Jan 24 00:39:31 files npm[1022]:     at emitOne (events.js:116:13)
Jan 24 00:39:31 files npm[1022]:     at TLSSocket.emit (events.js:211:7)
Jan 24 00:39:31 files npm[1022]:     at emitErrorNT (internal/streams/destroy.js:64:8)
Jan 24 00:39:31 files npm[1022]:     at _combinedTickCallback (internal/process/next_tick.js:138:11)
Jan 24 00:39:31 files npm[1022]:     at process._tickCallback (internal/process/next_tick.js:180:9)
Jan 24 00:39:31 files npm[1022]: npm ERR! code ELIFECYCLE
Jan 24 00:39:31 files npm[1022]: npm ERR! errno 1
Jan 24 00:39:31 files npm[1022]: npm ERR! [email protected] start: `node discord_bot.js`
Jan 24 00:39:31 files npm[1022]: npm ERR! Exit status 1
Jan 24 00:39:31 files npm[1022]: npm ERR!
Jan 24 00:39:31 files npm[1022]: npm ERR! Failed at the [email protected] start script.
Jan 24 00:39:31 files npm[1022]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Jan 24 00:39:31 files npm[1022]: ┌──────────────────────────────────────────────────────────────┐
Jan 24 00:39:31 files npm[1022]: │                   npm update check failed                    │
Jan 24 00:39:31 files npm[1022]: │             Try running with sudo or get access              │
Jan 24 00:39:31 files npm[1022]: │             to the local update config store via             │
Jan 24 00:39:31 files npm[1022]: │ sudo chown -R $USER:$(id -gn $USER) /home/Discordbot/.config │
Jan 24 00:39:31 files npm[1022]: └──────────────────────────────────────────────────────────────┘
Jan 24 00:39:31 files systemd[1]: GW2_Discordbot.service: Main process exited, code=exited, status=1/FAILURE
Jan 24 00:39:31 files systemd[1]: GW2_Discordbot.service: Unit entered failed state.
Jan 24 00:39:31 files systemd[1]: GW2_Discordbot.service: Failed with result 'exit-code'.

node --version results in v8.9.4

I believe there was a node.js update rolled out in the last couple days that could be related, though node.js is alien to me so I wouldn't know where to look for more details.

Please let me know if there is any other information that I can gather.

Not really an issue, cant find a better way to contact you

Hi Nabrok,

sorry for bothering you. So when people change servers, the bot will see that their server was changed and update their server role accordingly. I was looking in the redis database, and to my surprise I could not find any full length API-keys anywhere in the db. How does the bot query API-keys? If I look up my own Discord ID in the db, the API-key I get in return cant be queried by me. Its not full length. Am I missing something here? Is it possible to find full length API-keys anywhere? Thanks in advance.

[Help] What is the best OS ?

I put a GW2 api with a pm to the bot like this one

link APIKEY

But I think the Key didn't saved to the bot database

And I don't know how to do this
and don't understand if the unix socket is required or not and how to do this


`[redis]
host = "127.0.0.1"
port = "6379"
path = "" # path to unix socket, use this over host/port if you can.
password = ""
db = "0" # database number

[world]
id = 2104 # world member has to be on to get in role, and default world for wvw stuffs.
role = "" # Name of the role, leave blank if you don't want this

[guild]
id = "C56F040F-1CF1-E611-80D3-AC162DC0847D" # Guild unique ID in format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX, this can be found at https://api.guildwars2.com/v2/guild/search?name=[guild name]
key = "" # API Key from top guild rank with the "guilds" permission
member_role = "Membre certifié" # Name of the role guild members go in
create_roles = true # Have the bot create roles for each rank. If false, members will only be assigned to their rank role if it exists.
motd_channel = "" # Will set the channel description to the guild motd
motd_convert_urls = true # Convert urls in the guild motd to actual urls that discord parses to a link, if they don't start with e.g. "http://"
motd_excluded_subdomains = [ # An array of url subdomains of which the url should not be converted (these are regular expressions)
"[^\\.]ts[^\\.]", # ts.example.com
"[^\\.]teamspeak[^\\.]" # teamspeak.example.com
]

[discord]
clientid = "336860774418874400" # Used to generate a link to add the bot to a server
client_secret = "" # Only required if "web" feature is enabled
token = "MzM2ODYwNzc0NDE4ODc0NDAw.DE-dkA.EFU53tpeRzDLUHvjfq-3RbM7HuI" # Token for your discord bot user

[web]
domain = "127.0.0.1"
protocol = "http"
port = "3000"
#public_url = "https://mydomain.com/" # Use this for the public url if behind a proxy (such as nginx)

[features]
language = "fr"
enabled = ["ranks", "motd", "wvw_score", "progression", "builds", "wiki", "session", "whois", "li"]
`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.