Giter Site home page Giter Site logo

discord-utilities's Introduction

Discord Utilities

Utilities that can be used to integrate gameserver to discord server.

Confused how this plugin will look? Join my discord (CruzeCoding) to have a look on how each feature look!

Credits

  • .#Zipcore (CallAdmin Discord's code)
  • Impact (CallAdmin Main plugin's code)
  • Bara (Discord Map Notification's code)
  • Nexd (Discord Server Manager [Most of the code is dependant on it]'s public code)

Special thanks to:

  • Deathknife for Discord API + helped me through adding roles on verfication module <3 Really nice guy
  • Nano for Admin chat relay and Admin logs! <3
  • Scai and xSL0W for fixing most of the memory leaks in the plugin <3

discord-utilities's People

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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

discord-utilities's Issues

on sm 1.11 not working

Compiling discord_utilities.sp...
SourcePawn Compiler 1.11.0.6927
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2021 AlliedModders LLC

discord_utilities/modules.sp(1) : warning 242: function "Timer_DisplayMapNotification" should return an explicit value
discord_utilities/sql.sp(81) : warning 209: function has explicit 'int' tag but does not return a value
discord_utilities/sql.sp(81) : warning 209: function has explicit 'int' tag but does not return a value
discord_utilities/sql.sp(81) : warning 209: function has explicit 'int' tag but does not return a value
discord_utilities/sql.sp(146) : warning 209: function has explicit 'int' tag but does not return a value
discord_utilities/sql.sp(225) : warning 209: function has explicit 'int' tag but does not return a value
discord_utilities/sql.sp(225) : warning 209: function has explicit 'int' tag but does not return a value
discord_utilities/forwards.sp(230) : warning 242: function "OnClientPreAdminCheck" should return an explicit value
discord_utilities/forwards.sp(230) : warning 242: function "OnClientPreAdminCheck" should return an explicit value
discord_utilities/forwards.sp(230) : warning 242: function "OnClientPreAdminCheck" should return an explicit value
discord_utilities/forwards.sp(263) : warning 209: function has explicit 'int' tag but does not return a value
discord_utilities/helpers.sp(89) : warning 209: function has explicit 'int' tag but does not return a value
discord_utilities/helpers.sp(765) : warning 209: function has explicit 'int' tag but does not return a value
discord_utilities/helpers.sp(1104) : warning 246: function ChangePartsInString returns an array but return type is not marked as an array
discord_utilities/discordrequest.sp(71) : warning 209: function has explicit 'int' tag but does not return a value
./include/smjansson.inc(874) : error 163: indeterminate array size in "sizeof" expression (symbol "sTmp")

Memory leak detection

I think memory was leaked due to this error.
Is there any way to fix it?

L 06/13/2021 - 14:39:32: [discord_api.smx] [DISCORD] Couldn't Send Webhook - Fail 0 400
L 06/13/2021 - 14:40:25: [discord_api.smx] [DISCORD] Couldn't Send Webhook - Fail 0 400

L 06/13/2021 - 14:47:04: [SM] MEMORY LEAK DETECTED IN PLUGIN (file "discord_api.smx")
L 06/13/2021 - 14:47:04: [SM] Unloading plugin to free 29259 handles.
L 06/13/2021 - 14:47:04: [SM] Contact the author(s) of this plugin to correct this error.
L 06/13/2021 - 14:47:04: --------------------------------------------------------------------------
L 06/13/2021 - 14:47:04: Type DataPack | Count 334
L 06/13/2021 - 14:47:04: Type PrivateFwd | Count 1
L 06/13/2021 - 14:47:04: Type Trie | Count 3
L 06/13/2021 - 14:47:04: Type HTTPHandle | Count 169
L 06/13/2021 - 14:47:04: Type JanssonObject | Count 28752
L 06/13/2021 - 14:47:04: --------------------------------------------------------------------------
L 06/13/2021 - 14:47:04: Oldest Living Handle: Trie created at 06/13/2021 - 14:01:12
L 06/13/2021 - 14:47:04: Newest Living Handle: JanssonObject created at 06/13/2021 - 14:47:04
L 06/13/2021 - 14:47:04: -- Approximately 27941 bytes of memory are in use by (29259) Handles.

L 06/13/2021 - 14:47:04: [SM] Exception reported: Memory leak
L 06/13/2021 - 14:47:04: [SM] Blaming: discord_api.smx
L 06/13/2021 - 14:47:04: [SM] Call stack trace:
L 06/13/2021 - 14:47:04: [SM] [0] DataPack.DataPack
L 06/13/2021 - 14:47:04: [SM] [1] Line 292, C:\Users\STARS\Desktop\Coding\Discord Utilities\scripting\discord_api.sp::UrlToDP
L 06/13/2021 - 14:47:04: [SM] [2] Line 70, discord/SendWebHook.sp::SendWebHook
L 06/13/2021 - 14:47:04: [SM] [3] Line 93, discord/SendWebHook.sp::SendWebHookReceiveData

Bug with CallAdminReportTitle in discord

Hi, I have detected a bug with the DU --> Calladmin .

The message for new calladmins is not displayed correctly, the title (CallAdminReportTitle) is missing.

CallAdminReportTitle is present in tranlastion, but not working

	"CallAdminReportTitle"
	{
		"en"		"New Calladmin"
		"fr"		"Nouveau CallAdmin"
		"hu"		"Egy jelentést éppen kezelnek!"
		"nl"		"De CallAdmin Report wordt behandelt!"
		"lv"		"CallAdmin Ziņojums tiek izskatīts!"
		"ru"		"CallAdmin Репорт обрабатывается!"
		"ro"		"CallAdmin Report se gestionează!"
	}

bug1

Check Images.

New Feature suggestion.

I would like to suggest making a way to execute admin commands Via the Discord server. I think it would be a great feature!

Also Maybe a way to subscribe to notifications for example if player X favorite map is de_mirage he subscribes to receive mention notification if server changes map to the de_mirage

One db two servers verification error

Found a little bug
If I have two servers connected to one database, then when the player is verified, he writes one message that the player is verified and the second that the player is not on the server

discord_utilities don't give role

L 04/19/2021 - 12:38:35: [SM] Blaming: discord_utilities.smx
L 04/19/2021 - 12:38:35: [SM] Call stack trace:
L 04/19/2021 - 12:38:35: [SM] [0] ThrowError
L 04/19/2021 - 12:38:35: [SM] [1] Line 75, C:\Users\STARS\Desktop\discord-utilities - Copy\discord-utilities-master\scripting\include\multicolors/colors.inc::C_PrintToChat
L 04/19/2021 - 12:38:35: [SM] [2] Line 76, C:\Users\STARS\Desktop\discord-utilities - Copy\discord-utilities-master\scripting\include\multicolors.inc::CPrintToChat
L 04/19/2021 - 12:38:35: [SM] [3] Line 520, discord_utilities/forwards.sp::Command_ViewId

Discord => Gameserver

This feature is not working for me. I have correctly filled out my Bot Token, Channel ID and Steam API key. Let me know if there is anything I can do to help with this issue.

Load failed

[SM] Plugin discord_utilities.smx failed to load: Native "DiscordUser.GetID" was not found.

Plugin not working

The plugin does not work, writes this in the console: discord_utilities.smx (Discord Utilities): Native "DiscordBot.StartTimer" was not found

400 error

L 12/09/2021 - 01:14:59: [discord_api.smx] [DISCORD] Couldn't Retrieve Messages - Fail 0 400

flooding server with this error, verification works fine.
what can be an issue and how to fix it?

Verification command fails

Hi! How can I make !link on discord to work? Bot says everytime:
This channel is being used for account linking!
Usage: !link

Theres no errors in the sourcemod logs file, thats the only thing Im getting, thanks.

DU gives an annoying error each time I talk to my server's chat via the console

Game

TF2

Description

Each time I talk in my server with the say command via the console, it gives me the following error:

11/05/2021 - 15:43:53: L 11/05/2021 - 15:43:53: [SM] Exception reported: Invalid client index 0
11/05/2021 - 15:43:53: L 11/05/2021 - 15:43:53: [SM] Blaming: basecomm.smx
11/05/2021 - 15:43:53: L 11/05/2021 - 15:43:53: [SM] Call stack trace:
11/05/2021 - 15:43:53: L 11/05/2021 - 15:43:53: [SM]   [0] ThrowNativeError
11/05/2021 - 15:43:53: L 11/05/2021 - 15:43:53: [SM]   [1] Line 39, /home/builds/sourcemod/linux-1.10/build/plugins/basecomm/natives.sp::Native_IsClientGagged
11/05/2021 - 15:43:53: L 11/05/2021 - 15:43:53: [SM]   [3] BaseComm_IsClientGagged
11/05/2021 - 15:43:53: L 11/05/2021 - 15:43:53: [SM]   [4] Line 137, discord_utilities/forwards.sp::OnClientSayCommand

Steps to Reproduce

1- Execute, server-side, the command say <Anything> once your server is fully loaded
2- Magic

Logs

11/05/2021 - 15:43:37: L 11/05/2021 - 15:43:37: [SM] Exception reported: Invalid client index 0
11/05/2021 - 15:43:37: L 11/05/2021 - 15:43:37: [SM] Blaming: basecomm.smx
11/05/2021 - 15:43:37: L 11/05/2021 - 15:43:37: [SM] Call stack trace:
11/05/2021 - 15:43:37: L 11/05/2021 - 15:43:37: [SM]   [0] ThrowNativeError
11/05/2021 - 15:43:37: L 11/05/2021 - 15:43:37: [SM]   [1] Line 39, /home/builds/sourcemod/linux-1.10/build/plugins/basecomm/natives.sp::Native_IsClientGagged
11/05/2021 - 15:43:37: L 11/05/2021 - 15:43:37: [SM]   [3] BaseComm_IsClientGagged
11/05/2021 - 15:43:37: L 11/05/2021 - 15:43:37: [SM]   [4] Line 137, discord_utilities/forwards.sp::OnClientSayCommand
11/05/2021 - 15:43:37: Console: corruped barney
11/05/2021 - 15:43:43: *DEAD* Haito: Barney?
11/05/2021 - 15:43:51: Client "♫" connected (censored).
11/05/2021 - 15:43:52: twitch.tv/carita_cp: ez
11/05/2021 - 15:43:53: L 11/05/2021 - 15:43:53: [SM] Exception reported: Invalid client index 0
11/05/2021 - 15:43:53: L 11/05/2021 - 15:43:53: [SM] Blaming: basecomm.smx
11/05/2021 - 15:43:53: L 11/05/2021 - 15:43:53: [SM] Call stack trace:
11/05/2021 - 15:43:53: L 11/05/2021 - 15:43:53: [SM]   [0] ThrowNativeError
11/05/2021 - 15:43:53: L 11/05/2021 - 15:43:53: [SM]   [1] Line 39, /home/builds/sourcemod/linux-1.10/build/plugins/basecomm/natives.sp::Native_IsClientGagged
11/05/2021 - 15:43:53: L 11/05/2021 - 15:43:53: [SM]   [3] BaseComm_IsClientGagged
11/05/2021 - 15:43:53: L 11/05/2021 - 15:43:53: [SM]   [4] Line 137, discord_utilities/forwards.sp::OnClientSayCommand
11/05/2021 - 15:43:53: Console: barney de half life/black mesa
11/05/2021 - 15:43:54: *DEAD* Haito: Ah
11/05/2021 - 15:43:58: L 11/05/2021 - 15:43:58: [SM] Exception reported: Invalid client index 0
11/05/2021 - 15:43:58: L 11/05/2021 - 15:43:58: [SM] Blaming: basecomm.smx
11/05/2021 - 15:43:58: L 11/05/2021 - 15:43:58: [SM] Call stack trace:
11/05/2021 - 15:43:58: L 11/05/2021 - 15:43:58: [SM]   [0] ThrowNativeError
11/05/2021 - 15:43:58: L 11/05/2021 - 15:43:58: [SM]   [1] Line 39, /home/builds/sourcemod/linux-1.10/build/plugins/basecomm/natives.sp::Native_IsClientGagged
11/05/2021 - 15:43:58: L 11/05/2021 - 15:43:58: [SM]   [3] BaseComm_IsClientGagged
11/05/2021 - 15:43:58: L 11/05/2021 - 15:43:58: [SM]   [4] Line 137, discord_utilities/forwards.sp::OnClientSayCommand
11/05/2021 - 15:43:58: Console: a

Additional Context

I thought this was a SourceMod issue, but after going to the GitHub issues of them, they told me it was DU's fault alliedmodders/sourcemod#1632

List of kicked people

Hey, are you able to do a similar module of people who got kick, similar to how the information about the ban appears

Discord Server > Game Server relay not functioning as intended.

I am having an issue with the Discord Server > Game Server relay not functioning properly. For the past 2-3 months it has worked fine but just recently instead of posting the discord users message through to the game server, it does the [Discord] tag, their username, and then where the message is meant to be is blank. I have reinstalled Discord Utilites, done fresh wipes of the Discord-Utilities.cfg file, deleted the database file, and yet nothing seems to work. Any assistance would be amazing, and thank you for your time.
image

Deleting old map entries

The idea is that the old records on the discord channel about what is currently on the server are deleted so that there is some kind of monitoring.

DU floods the server console sometimes

11/05/2021 - 17:52:20: L 11/05/2021 - 17:52:20: [SM] Exception reported: Invalid Handle 0 (error: 4)
11/05/2021 - 17:52:20: L 11/05/2021 - 17:52:20: [SM] Blaming: discord_api.smx
11/05/2021 - 17:52:20: L 11/05/2021 - 17:52:20: [SM] Call stack trace:
11/05/2021 - 17:52:20: L 11/05/2021 - 17:52:20: [SM]   [0] SteamWorks_SetHTTPCallbacks
11/05/2021 - 17:52:20: L 11/05/2021 - 17:52:20: [SM]   [1] Line 76, C:\Users\xSLOW\Desktop\compilerV2\include\discord/DiscordRequest.sp::DiscordRequest.SetCallbacks
11/05/2021 - 17:52:20: L 11/05/2021 - 17:52:20: [SM]   [2] Line 58, C:\Users\xSLOW\Desktop\compilerV2\include\discord/SendWebHook.sp::SendWebHook
11/05/2021 - 17:52:20: L 11/05/2021 - 17:52:20: [SM]   [3] Line 84, C:\Users\xSLOW\Desktop\compilerV2\include\discord/SendWebHook.sp::SendWebHookReceiveData

This starts to get flooded a lot in a short period of time, I am not able to consistently reproduce this.

Exception reported: Client 8 is not in game (discord_utilities/forwards.sp::Check)

On this new version, this plugin are flooding errors, sometimes does not verify the client.

Filename: discord_api.smx
Title: Discord API
Author: Deathknife
Version: 0.1.103
Status: running
Timestamp: 04/26/2022 20:54:28
Filename: discord_utilities.smx
Title: Discord Utilities (Utilities that can be used to integrate gameserver to discord server I guess?)
Author: Cruze
Version: 2.9.3-BETA
URL: https://github.com/Cruze03/discord-utilities | http://www.steamcommunity.com/profiles/76561198132924835
Status: running
Timestamp: 05/27/2022 23:59:44
Exception reported: Client 8 is not in game
[SM] Blaming: discord_utilities.smx
[SM] Call stack trace:
[SM]   [0] ThrowError
[SM]   [1] Line 75, F:\CSGO Server Plugin n stuff\Coding\Stuff\Discord Utilities\scripting\include\multicolors/colors.inc::C_PrintToChat
[SM]   [2] Line 76, F:\CSGO Server Plugin n stuff\Coding\Stuff\Discord Utilities\scripting\include\multicolors.inc::CPrintToChat
[SM]   [3] Line 652, discord_utilities/forwards.sp::Check

memory leak/ failed to send webhook 0 0

Hello, i fixed this problem:
discord_utilities/forwards.sp

public Action OnLogAction(Handle hSource, Identity ident, int client, int target, const char[] sMsg)
{
	if(StrEqual(g_sAdminLog_Webhook, ""))
	{
		return Plugin_Continue;
	}
	
	if(client <= 0)
	{
		return Plugin_Continue;
	}

	if(StrContains(sMsg, "sm_chat", false) != -1)
	{
		return Plugin_Continue;// dont log sm_chat because it's already being showed in admin chat relay channel.
	}
	
	SendAdminLog(client, sMsg);

	return Plugin_Continue;
}

managed to fix it by adding

if(StrEqual(g_sAdminLog_Webhook, ""))
	{
		return Plugin_Continue;
	}

I didnt used this module, so my URL was blank. This was causing an exception somewhere deeper in the code and throwed error Failed to send webhook 0 0 everytime LogMessage occured from a plugin. This caused a memleak too.

non admins say_team @messages

Hi.

I don't want non-admin messages to appear in the discord room.
sm_chat_mode 0 is set on the server but the discord room (sm_du_adminchat_webhook) shows the messages of non-admin players.

Translation:

	"ChatRelayPrivateToAdmins"
	{
		"en"		"Private To Admins: "
		"hu"		"Üzenet Adminoknak: "
		"nl"		"Prive naar Admins: "
		"lv"		"Privāti adminiem: "
		"ru"		"Приват для администраторов: "
		"ro"		"Privat către Admini: "
	}

Is it possible that non-admin players do not print messages in the discord room? Thanks in advance.

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.