sbpp / discord-forward

Listens for forward SBPP_OnBanPlayer and SBPP_OnReportPlayer and sends it to Discord's webhook endpoint(s)
https://sbpp.github.io
GNU General Public License v3.0
6 stars 4 forks source link

Not reporting to discord #10

Closed Aham-Admin closed 5 years ago

Aham-Admin commented 5 years ago

Its not letting reporting to the discord? Error log L 05/22/2019 - 18:01:30: SourceMod error session started L 05/22/2019 - 18:01:30: Info (map "de_dust2") (file "errors_20190522.log") L 05/22/2019 - 18:01:30: [sbpp_discord.smx] HTTP request failed for Aham against Aham L 05/22/2019 - 18:01:40: [SM] Exception reported: Client index 1 is invalid (arg 2) L 05/22/2019 - 18:01:40: [SM] Blaming: sbpp_discord.smx L 05/22/2019 - 18:01:40: [SM] Call stack trace: L 05/22/2019 - 18:01:40: [SM] [0] LogError L 05/22/2019 - 18:01:40: [SM] [1] Line 242, sbpp_discord.sp::OnHTTPRequestComplete

rumblefrog commented 5 years ago

Please provide version/commit hash, game & version, and the reproduction steps

Aham-Admin commented 5 years ago

The plugin version is v1.1.0 and the latest game, And I put in the start config the "sbpp_discord_banhook https://discordapp.com/api/webhooks/------------/----------- ". I dont know if I did it write or not, Or If I have to put it in a different config

rumblefrog commented 5 years ago

sbpp_discord.zip

Here's a debug version, try it out and send logs again.

Aham-Admin commented 5 years ago

heres the logs, Its the same things as before though, I changed the discord link from https:// to one without though, still didnt help

L 05/23/2019 - 16:33:36: SourceMod error session started L 05/23/2019 - 16:33:36: Info (map "de_dust2") (file "errors_20190523.log") L 05/23/2019 - 16:33:36: [sbpp_discord.smx] HTTP request failed for Aham against Aham L 05/23/2019 - 16:33:41: [SM] Exception reported: Client index 1 is invalid (arg 2) L 05/23/2019 - 16:33:41: [SM] Blaming: sbpp_discord.smx L 05/23/2019 - 16:33:41: [SM] Call stack trace: L 05/23/2019 - 16:33:41: [SM] [0] LogError L 05/23/2019 - 16:33:41: [SM] [1] Line 250, F:\Github\discord-forward\sbpp_discord.sp::OnHTTPRequestComplete L 05/23/2019 - 16:42:08: SourceMod error session started L 05/23/2019 - 16:42:08: Info (map "de_dust2") (file "errors_20190523.log") L 05/23/2019 - 16:42:08: [sbpp_discord.smx] HTTP request failed for Aham against Aham

rumblefrog commented 5 years ago

It should've printed much more than that, can you check the console for more outputs.

Aham-Admin commented 5 years ago

L 05/23/2019 - 20:21:37: SourceMod error session started L 05/23/2019 - 20:21:37: Info (map "de_overpass") (file "errors_20190523.log") L 05/23/2019 - 20:21:37: [sbpp_discord.smx] Missing ban hook endpoint L 05/23/2019 - 20:24:17: [sbpp_discord.smx] Missing ban hook endpoint

rumblefrog commented 5 years ago

Yeah, you sure you are setting the convar properly?

Aham-Admin commented 5 years ago

I have it set as discordapp.com/api/webhooks without the https://

rumblefrog commented 5 years ago

Include the protocol, otherwise, it's not a valid URL.

Aham-Admin commented 5 years ago

Its still not working the link is https://discordapp.com/api/webhooks/--------------/------------------------------------------ is there anything else I should add

rumblefrog commented 5 years ago

Please show the complete convar usage, did you quote the entirety of the URL?

Aham-Admin commented 5 years ago

Got it working, Had to add ""

freakexeuLow commented 4 years ago

Sorry rumblefrog that I open up this subject, but i get the same problem

Convars[Ban] = CreateConVar("sbpp_discord_banhook", "https://discordapp.com/api/webhooks/664160099027386390/1XAy926sNLp9spPP51_E**************************************", "Discord web hook endpoint for ban forward", FCVAR_PROTECTED);

and he says the same as already posted here by the user [sbpp_discord.smx] Missing ban hook endpoint

What's the mistake? I am mega confused right now Info: I have replaced it with stars in my webhook, in my file is the complete code inside :3

TheByKotik commented 4 years ago

Sorry rumblefrog that I open up this subject, but i get the same problem

Convars[Ban] = CreateConVar("sbpp_discord_banhook", "https://discordapp.com/api/webhooks/664160099027386390/1XAy926sNLp9spPP51_E**************************************", "Discord web hook endpoint for ban forward", FCVAR_PROTECTED);

and he says the same as already posted here by the user [sbpp_discord.smx] Missing ban hook endpoint

What's the mistake? I am mega confused right now Info: I have replaced it with stars in my webhook, in my file is the complete code inside :3

I'm understand correctly, you hardcoded webhook url?

rumblefrog commented 4 years ago

Why not use the convar as it is intended? Also, it only retrieves its values when it's updated, so it may never update and remain blank.

freakexeuLow commented 4 years ago

Sorry rumblefrog that I open up this subject, but i get the same problem Convars[Ban] = CreateConVar("sbpp_discord_banhook", "https://discordapp.com/api/webhooks/664160099027386390/1XAy926sNLp9spPP51_E**************************************", "Discord web hook endpoint for ban forward", FCVAR_PROTECTED); and he says the same as already posted here by the user [sbpp_discord.smx] Missing ban hook endpoint What's the mistake? I am mega confused right now Info: I have replaced it with stars in my webhook, in my file is the complete code inside :3

I'm understand correctly, you hardcoded webhook url?

I'm already used to setting it that way

Why not use the convar as it is intended? Also, it only retrieves its values when it's updated, so it may never update and remain blank.

bad, I don't like to put everything in the server.cfg, I always want to have that in the plugin :3

TheByKotik commented 4 years ago

Sorry rumblefrog that I open up this subject, but i get the same problem

Convars[Ban] = CreateConVar("sbpp_discord_banhook", "https://discordapp.com/api/webhooks/664160099027386390/1XAy926sNLp9spPP51_E**************************************", "Discord web hook endpoint for ban forward", FCVAR_PROTECTED);

and he says the same as already posted here by the user [sbpp_discord.smx] Missing ban hook endpoint

What's the mistake? I am mega confused right now Info: I have replaced it with stars in my webhook, in my file is the complete code inside :3

I'm checked it and problem not in hardcoded webhook. This can be happened if not called OnConfigsExecuted or convars been overwritten with empty string. And problem may be in L101 because checked only ban webhook.

You need put debug outputs in this places.

freakexeuLow commented 4 years ago

Sorry rumblefrog that I open up this subject, but i get the same problem Convars[Ban] = CreateConVar("sbpp_discord_banhook", "https://discordapp.com/api/webhooks/664160099027386390/1XAy926sNLp9spPP51_E**************************************", "Discord web hook endpoint for ban forward", FCVAR_PROTECTED); and he says the same as already posted here by the user [sbpp_discord.smx] Missing ban hook endpoint What's the mistake? I am mega confused right now Info: I have replaced it with stars in my webhook, in my file is the complete code inside :3

I'm checked it and problem not in hardcoded webhook. This can be happened if not called OnConfigsExecuted or convars been overwritten with empty string. And problem may be in L101 because checked only ban webhook.

You need put debug outputs in this places.

What exactly do you mean by debug outputs? Would you show me the final result via pastebin.com? :3

TheByKotik commented 4 years ago

Sorry rumblefrog that I open up this subject, but i get the same problem Convars[Ban] = CreateConVar("sbpp_discord_banhook", "https://discordapp.com/api/webhooks/664160099027386390/1XAy926sNLp9spPP51_E**************************************", "Discord web hook endpoint for ban forward", FCVAR_PROTECTED); and he says the same as already posted here by the user [sbpp_discord.smx] Missing ban hook endpoint What's the mistake? I am mega confused right now Info: I have replaced it with stars in my webhook, in my file is the complete code inside :3

I'm checked it and problem not in hardcoded webhook. This can be happened if not called OnConfigsExecuted or convars been overwritten with empty string. And problem may be in L101 because checked only ban webhook. You need put debug outputs in this places.

What exactly do you mean by debug outputs? Would you show me the final result via pastebin.com? :3

Try this version. In main sm log you will see what's wrong with webhooks. Expected one call OnConfigsExecuted with correct webhooks and no call for OnConvarChanged. I think the problem is somewhere in that.

freakexeuLow commented 4 years ago

Sorry rumblefrog that I open up this subject, but i get the same problem Convars[Ban] = CreateConVar("sbpp_discord_banhook", "https://discordapp.com/api/webhooks/664160099027386390/1XAy926sNLp9spPP51_E**************************************", "Discord web hook endpoint for ban forward", FCVAR_PROTECTED); and he says the same as already posted here by the user [sbpp_discord.smx] Missing ban hook endpoint What's the mistake? I am mega confused right now Info: I have replaced it with stars in my webhook, in my file is the complete code inside :3

I'm checked it and problem not in hardcoded webhook. This can be happened if not called OnConfigsExecuted or convars been overwritten with empty string. And problem may be in L101 because checked only ban webhook. You need put debug outputs in this places.

What exactly do you mean by debug outputs? Would you show me the final result via pastebin.com? :3

Try this version. In main sm log you will see what's wrong with webhooks. Expected one call OnConfigsExecuted with correct webhooks and no call for OnConvarChanged. I think the problem is somewhere in that.

Thanks and sm plugins load sbpp_discord_debug.smx

L 01/11/2020 - 19:33:29: [sbpp_discord_debug.smx] OnConfigsExecuted() Ban: https://discordapp.com/api/webhooks/664160099027386390/1XAy926sNLp9spPP51_EAdM4x_*** L 01/11/2020 - 19:33:29: [sbpp_discord_debug.smx] OnConfigsExecuted() Report: L 01/11/2020 - 19:33:29: [sbpp_discord_debug.smx] OnConfigsExecuted() Comms: [SM] Loaded plugin sbpp_discord_debug.smx successfully.

and how does the system recognize the sourcebans of the ban and report them in the discord? With ZipCore you have to insert the URL from the ban page

rumblefrog commented 4 years ago

With the forwards?

freakexeuLow commented 4 years ago

With the forwards?

??? i only download TheByKotik sp file and add the webhook (I put the stars end of the webhook, the original Webhook is fine and have not stars). sbpp_discord_debug.zip

rumblefrog commented 4 years ago

and how does the system recognize the sourcebans of the ban and report them in the discord

It uses the forwards. If I understand the question correctly.

Also, you should really be opening your own issue instead of hitchhiking another one that does not hardcode the value.

Aham-Admin commented 4 years ago

Yea, This was about me being a bad programmer and missing things like semi colons and "". please close this again and open up a new issue

freakexeuLow commented 4 years ago

Okay and sry AhamYT^^