Raised This Month: $442 Target: $400
 110% 

[ANY] Discord API (Send/Retrieve messages, list Guilds/Channels) UPDATE: 10/1/17


Post New Thread Reply   
 
Thread Tools Display Modes
Facksy
Senior Member
Join Date: Apr 2017
Location: +2+2
Old 11-09-2018 , 13:42   Re: [ANY] Discord API (Send/Retrieve messages, list Guilds/Channels) UPDATE: 10/1/17
Reply With Quote #41

Hey guys, im trying to make a script which allow people with certain roles to relay message to the server.
For example, if a guy have the role "Root", it will send the message to the server but if he dont have it, it wont send. The problem is that I don't know how to check if some user has this role, I dont know how to get role of the message author, I tried to use message.GetAuthor().GetRoles() but it didnt work
__________________
My Steam I take private requests if related with TF2
My Plugins
My PayPal if you like my work
Facksy is offline
Naydef
Senior Member
Join Date: Dec 2015
Location: Doom Town, Nevada
Old 02-10-2019 , 10:20   Re: [ANY] Discord API (Send/Retrieve messages, list Guilds/Channels) UPDATE: 10/1/17
Reply With Quote #42

Obviously this plugin is leaking tons of memory and causes server crashes in combination with plugins which use the API
Version: 0.1.103
Code:
L 02/10/2019 - 11:45:01: [SM] MEMORY LEAK DETECTED IN PLUGIN (file "discord_api.smx")
461414 	96246.456544 	L 02/10/2019 - 11:45:01: [SM] Unloading plugin to free 21886 handles.
461415 	96246.456767 	L 02/10/2019 - 11:45:01: [SM] Contact the author(s) of this plugin to correct this error.
461416 	96246.456951 	L 02/10/2019 - 11:45:01: --------------------------------------------------------------------------
461417 	96246.458203 	L 02/10/2019 - 11:45:01: Type	DataPack            |	Count	21
461418 	96246.458431 	L 02/10/2019 - 11:45:01: Type	Timer               |	Count	2
461419 	96246.458598 	L 02/10/2019 - 11:45:01: Type	PrivateFwd          |	Count	21749
461420 	96246.458749 	L 02/10/2019 - 11:45:01: Type	Trie                |	Count	3
461421 	96246.458889 	L 02/10/2019 - 11:45:01: Type	HTTPHandle          |	Count	39
461422 	96246.459024 	L 02/10/2019 - 11:45:01: Type	JanssonObject       |	Count	72
__________________
My plugins:
Admin Stealth REDUX(v1.6.1)

Non-Sourcemod related projects:
8086eD x86 Emulator

Steam:
naydef

Last edited by Naydef; 02-10-2019 at 10:21.
Naydef is offline
paulo_crash
AlliedModders Donor
Join Date: May 2016
Location: Brazil
Old 07-07-2019 , 12:26   Re: [ANY] Discord API (Send/Retrieve messages, list Guilds/Channels) UPDATE: 10/1/17
Reply With Quote #43

You could correct this error:
Code:
L 07/07/2019 - 12:52:16: [discord_api.smx] [DISCORD] Couldn't Send Webhook - Fail 0 400
This shows on the servers console:
Code:
BAD REQUEST

DATA RECE: {"attachments": ["0"]}

DATA SENT: {"username": "Map Notifications", "attachments": [{"color": "00FF3C", "title": "#1 - ZK Servidores [ COMPETITIVO ] @MGTHOST1.COM.BR", "thumb_url": "https://image.gametracker.com/images/maps/160x120/csgo/de_dust2.jpg", "fields": [{"value": "de_dust2", "short": true, "title": "Mapa Atual:"}, {"value": "1/12", "short": true, "title": "Players Online:"}, {"value": "steam://connect/185.50.105.218:27120", "short": true, "title": "Connect:"}]}]}

L 07/07/2019 - 21:18:05: [discord_api.smx] [DISCORD] Couldn't Send Webhook - Fail 0 400
__________________

Last edited by paulo_crash; 07-07-2019 at 20:20.
paulo_crash is offline
alphaearth
Senior Member
Join Date: Feb 2018
Location: Turkey
Old 11-13-2019 , 07:51   Re: [ANY] Discord API (Send/Retrieve messages, list Guilds/Channels) UPDATE: 10/1/17
Reply With Quote #44

L 11/13/2019 - 12:47:55: [DISCORD] Couldn't Send Webhook - Fail 0 0

Can you fix this error?
__________________
alphaearth is offline
OcC
Senior Member
Join Date: Mar 2012
Location: Romania
Old 11-21-2019 , 17:58   Re: [ANY] Discord API (Send/Retrieve messages, list Guilds/Channels) UPDATE: 10/1/17
Reply With Quote #45

14:29:55: [DISCORD] Couldn't Send Webhook - Fail 0 0
Fix ?
__________________

Infinityzone.ro
Sorry For My Bad English

Last edited by OcC; 11-24-2019 at 07:33.
OcC is offline
Send a message via Yahoo to OcC
HiddenConn1
AlliedModders Donor
Join Date: Aug 2009
Location: Cambridge, UK
Old 02-10-2020 , 16:02   Re: [ANY] Discord API (Send/Retrieve messages, list Guilds/Channels) UPDATE: 10/1/17
Reply With Quote #46

Is this still being maintained or support being given?

I'm unable to compile the discord_api because it says "Could not find "discord_api.smx", please make sure you can access this file and retry." When I compile using command line in the folder correctly I get:
Quote:
C:\Users\kylei\Downloads\pstudio-0.8.3\scripting>compile discord_api.sp
//SourceMod Batch Compiler
// by the SourceMod Dev Team


//// discord_api.sp
//
// C:\Users\kylei\Downloads\pstudio-0.8.3\scripting\include\smjansson.inc(66) : error 173: 'in' is a newly reserved keyword that may be used in the future; use a different name as an identifier
// discord_api.sp(146) : warning 203: symbol is never used: "JsonObjectGetInt"
//
// 1 Error.
//
// Compilation Time: 0.67 sec
// ----------------------------------------

Press enter to exit ...
__________________
HiddenConn1 is offline
Tonblader
Member
Join Date: Jul 2011
Old 04-24-2020 , 16:24   Re: [ANY] Discord API (Send/Retrieve messages, list Guilds/Channels) UPDATE: 10/1/17
Reply With Quote #47

Quote:
Originally Posted by HiddenConn1 View Post
Is this still being maintained or support being given?

I'm unable to compile the discord_api because it says "Could not find "discord_api.smx", please make sure you can access this file and retry." When I compile using command line in the folder correctly I get:
Use this version of smjansson.inc
https://forums.alliedmods.net/showpo...6&postcount=50

by the way, does anyone know why I can't compile the files:

GetGuildChannels.sp
GetGuilds.sp
ListenToChannel.sp
SendMessage.sp

Quote:
Originally Posted by BasicPawn Compiler
Compiling source started!
Compiling failed! Compiler can not be found!
EDIT: does not need to compile, it is specified in discord_api.sp
Apparently I can't get any errors thrown at me, could it be that I did something wrong about getting my bot's token?

Last edited by Tonblader; 04-24-2020 at 17:04.
Tonblader is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:16.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode