Raised This Month: $90 Target: $400
 22% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Deathknife
Senior Member
Join Date: Aug 2014
Plugin ID:
5478
Plugin Version:
0.1.12
Plugin Category:
Technical/Development
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Allows plugins to send and retrieve messages, as well as list Guilds and channels for guilds.
    Old 01-06-2017 , 15:45   [ANY] Discord API (Send/Retrieve messages, list Guilds/Channels) UPDATE: 10/1/17
    Reply With Quote #1

    About:
    Provides an API that allows plugins to:
    - Listen to messages on Channel
    - Send Messages to a Channel
    - Get Guilds
    - Get Channels for a Guild

    It's barebone now, just the basics. If people are interested I can add more features. Check github page for some documentation.

    Bot token can be obtained from https://discordapp.com/developers/applications/me

    Dependencies:

    SteamWorks
    smjansson

    Changelog:
    Quote:
    v0.1.12
    * Fixed Guild Channels list error 429 support
    * Made requests retry in two seconds if it fails to create HTTP request. This usually happens when server just launched.

    v0.1.10
    - Removed unnecessary includes that are not used. (cstrike include prevented it from running on TF2) Should be fine now
    + Added support if discord returns too many requests. Running plugin on multiple servers should no longer be an issue.

    v0.1.1
    + Added Support for x-rate-limit (not global yet)

    v0.1.0
    + Initial Release
    Github Repository

    EXAMPLES (Call admin, server announcements from discord)
    Attached Files
    File Type: zip discord_api.zip (38.1 KB, 916 views)
    __________________

    Last edited by Deathknife; 01-10-2017 at 15:30.
    Deathknife is offline
    Headline
    SourceMod Moderator
    Join Date: Mar 2015
    Old 01-06-2017 , 16:50   Re: Discord API (Send/Retrieve messages, list Guilds/Channels)
    Reply With Quote #2

    Really cool!
    Headline is offline
    skinheadxtreme
    AlliedModders Donor
    Join Date: Jul 2013
    Old 01-07-2017 , 08:19   Re: Discord API (Send/Retrieve messages, list Guilds/Channels)
    Reply With Quote #3

    could you show some screens?
    skinheadxtreme is offline
    Deathknife
    Senior Member
    Join Date: Aug 2014
    Old 01-07-2017 , 10:57   Re: Discord API (Send/Retrieve messages, list Guilds/Channels)
    Reply With Quote #4

    Added some examples & support for x-rate-limiting

    Quote:
    Originally Posted by skinheadxtreme View Post
    could you show some screens?
    Here's a video https://www.youtube.com/watch?v=3jgqg96i77E
    __________________
    Deathknife is offline
    Aymeric VII
    BANNED
    Join Date: Jun 2016
    Location: Hiding under my sheets
    Old 01-07-2017 , 13:14   Re: Discord API (Send/Retrieve messages, list Guilds/Channels)
    Reply With Quote #5

    Damn thats fucking sweet, thanks for this.
    Aymeric VII is offline
    my11
    Member
    Join Date: Feb 2015
    Location: Argentina
    Old 01-07-2017 , 13:19   Re: Discord API (Send/Retrieve messages, list Guilds/Channels)
    Reply With Quote #6

    Nice!!
    __________________
    my11 is offline
    Xenoadria
    Member
    Join Date: Oct 2016
    Old 01-08-2017 , 21:38   Re: [ANY] Discord API (Send/Retrieve messages, list Guilds/Channels)
    Reply With Quote #7

    Seems great. Planning to get this work first thing tommorow, however I am having some concerns.
    I'm having more than 1 server, 4 to be exact. Making a configuration, and putting the same configuration on all the servers would make all calladmin messages arrive at same channel on discord meaning I wouldnt be able to recognize from which server the report came ? Same thing goes for the announcements, if it's same configuration, writing an announcement on the discord would send the announcement on every server ?
    Am I mistaking somewhere ?
    So I'm asking, is it possible somehow to make this plugin to "search" for different named channels to send messages on discord (meaning I need to create only more channels on discord) or for the specific situation that I am having (4 servers and would like to have calladmin and announcements on all of them seperatly), I would need to make 4 bots with more differently named channels?

    Maybe some of this is stupid, but I was just curiuos. Once again I love this and good job for the idea.

    Suggestion for call admin (if its possible). When !calladmin in game is written. A menu pops up to select a player which you want to report, afterwards you pick a reason and then report comes on discord. It would help admins know for what exactly they are being called.

    Best regards

    Last edited by Xenoadria; 01-08-2017 at 21:40.
    Xenoadria is offline
    Maxximou5
    AlliedModders Donor
    Join Date: Feb 2013
    Old 01-08-2017 , 23:48   Re: [ANY] Discord API (Send/Retrieve messages, list Guilds/Channels)
    Reply With Quote #8

    Really awesome to have!
    Should prove really useful with adding it's functionality to other plugins.
    __________________
    Maxximou5 is offline
    Deathknife
    Senior Member
    Join Date: Aug 2014
    Old 01-09-2017 , 12:30   Re: [ANY] Discord API (Send/Retrieve messages, list Guilds/Channels)
    Reply With Quote #9

    Quote:
    Originally Posted by Xenoadria View Post
    Seems great. Planning to get this work first thing tommorow, however I am having some concerns.
    I'm having more than 1 server, 4 to be exact. Making a configuration, and putting the same configuration on all the servers would make all calladmin messages arrive at same channel on discord meaning I wouldnt be able to recognize from which server the report came ? Same thing goes for the announcements, if it's same configuration, writing an announcement on the discord would send the announcement on every server ?
    Am I mistaking somewhere ?
    So I'm asking, is it possible somehow to make this plugin to "search" for different named channels to send messages on discord (meaning I need to create only more channels on discord) or for the specific situation that I am having (4 servers and would like to have calladmin and announcements on all of them seperatly), I would need to make 4 bots with more differently named channels?

    Maybe some of this is stupid, but I was just curiuos. Once again I love this and good job for the idea.

    Suggestion for call admin (if its possible). When !calladmin in game is written. A menu pops up to select a player which you want to report, afterwards you pick a reason and then report comes on discord. It would help admins know for what exactly they are being called.

    Best regards
    The call admin sends the server name & IP along with the message so it shouldn't be much of a problem. Either way, if you want to send messages to different channels, just replace "call-admin" and "server-"(whatever it was, I forgot) in the .sp with your channel name of choosing and compile. They can all use the same bot.

    However that said, currently there's a certain limitation when running more than one server on the same Bot. Discord has x-rate-limits (for example, getting guilds, 1 max every few seconds). While I implemented x-rate-limit support, it will only work fully if there's one server as my implementation of the x-rate-limit depends on each request to succeed. For example, If two servers launch at the same time and send guild list request at same time, one will succeed and the other won't. This is because server 2 was returned an error 429 instead of guilds list. I will implement support for this when I get time, possibly tomorrow. Until then, if you are running more than one server, try starting up the plugins at different time.

    It's a good idea, for now I'm keeping it barebone as it's just meant to be an example. I will probably later on expand it and possibly add that though.
    __________________

    Last edited by Deathknife; 01-10-2017 at 13:04. Reason: Not anymore
    Deathknife is offline
    MrDanne
    Member
    Join Date: Jan 2017
    Location: Stockholm, Sweden
    Old 01-10-2017 , 04:43   Re: [ANY] Discord API (Send/Retrieve messages, list Guilds/Channels)
    Reply With Quote #10

    Nice plugin, looking forward to try this on my server.

    Do you have any plan on making it work with sourcebans++ ?
    MrDanne 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 17:21.


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