SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 02/07/2018, 07:27 PM   #201
kovac
Banned
 
Join Date: Mar 2018
Posts: 182
Reputation: 14
Default Re: Discord Connector

[07/02/18 21:16:35] [plugins/discord-connector] can't update guild member presence: guild id "online" not cached
[07/02/18 21:17:05] [plugins/discord-connector] can't update guild member presence: guild id "offline" not cached
[07/02/18 21:17:35] [plugins/discord-connector] can't update guild member presence: guild id "online" not cached
[07/02/18 21:18:35] [plugins/discord-connector] can't update guild member presence: guild id "online" not cached
[07/02/18 21:19:34] [plugins/discord-connector] can't update guild member presence: guild id "online" not cached
[07/02/18 21:19:35] [plugins/discord-connector] can't update guild member presence: guild id "online" not cached
[07/02/18 21:19:42] [plugins/discord-connector] can't update guild member presence: guild id "online" not cached
[07/02/18 21:20:35] [plugins/discord-connector] can't update guild member presence: guild id "online" not cached
[07/02/18 21:21:35] [plugins/discord-connector] can't update guild member presence: guild id "online" not cached
[07/02/18 21:22:07] [plugins/discord-connector] can't update guild member presence: guild id "online" not cached
[07/02/18 21:22:17] [plugins/discord-connector] can't update guild member presence: guild id "online" not cached
[07/02/18 21:22:19] [plugins/discord-connector] can't update guild member presence: guild id "online" not cached
[07/02/18 21:22:35] [plugins/discord-connector] can't update guild member presence: guild id "online" not cached
[07/02/18 21:23:35] [plugins/discord-connector] can't update guild member presence: guild id "online" not cached
[07/02/18 21:24:35] [plugins/discord-connector] can't update guild member presence: guild id "online" not cached



.....
non stop
kovac is offline   Reply With Quote
Old 03/07/2018, 01:03 PM   #202
iSpark
Little Clucker
 
Join Date: Apr 2017
Posts: 42
Reputation: 3
Default Re: Discord Connector

Quote:
Originally Posted by kovac View Post
[07/02/18 21:16:35] [plugins/discord-connector] can't update guild member presence: guild id "online" not cached
[07/02/18 21:17:05] [plugins/discord-connector] can't update guild member presence: guild id "offline" not cached
[07/02/18 21:17:35] [plugins/discord-connector] can't update guild member presence: guild id "online" not cached
[07/02/18 21:18:35] [plugins/discord-connector] can't update guild member presence: guild id "online" not cached
[07/02/18 21:19:34] [plugins/discord-connector] can't update guild member presence: guild id "online" not cached
[07/02/18 21:19:35] [plugins/discord-connector] can't update guild member presence: guild id "online" not cached
[07/02/18 21:19:42] [plugins/discord-connector] can't update guild member presence: guild id "online" not cached
[07/02/18 21:20:35] [plugins/discord-connector] can't update guild member presence: guild id "online" not cached
[07/02/18 21:21:35] [plugins/discord-connector] can't update guild member presence: guild id "online" not cached
[07/02/18 21:22:07] [plugins/discord-connector] can't update guild member presence: guild id "online" not cached
[07/02/18 21:22:17] [plugins/discord-connector] can't update guild member presence: guild id "online" not cached
[07/02/18 21:22:19] [plugins/discord-connector] can't update guild member presence: guild id "online" not cached
[07/02/18 21:22:35] [plugins/discord-connector] can't update guild member presence: guild id "online" not cached
[07/02/18 21:23:35] [plugins/discord-connector] can't update guild member presence: guild id "online" not cached
[07/02/18 21:24:35] [plugins/discord-connector] can't update guild member presence: guild id "online" not cached



.....
non stop
I'm getting the same. And DCC_GetUserEmail returns a null string. Even though the DCC_User related to it has a valid string. Any help would be appreciated.
iSpark is offline   Reply With Quote
Old 08/07/2018, 03:15 PM   #203
shourya
Little Clucker
 
Join Date: Jun 2014
Location: india
Posts: 34
Reputation: 11
Default Re: Discord Connector

PHP Code:
Failed (/usr/lib/i386-linux-gnu/libstdc++.so.6version `GLIBCXX_3.4.20' not found (required by plugins/discord-connector.so)) 
ubuntu 14.04lts
__________________
shourya is offline   Reply With Quote
Old 09/07/2018, 04:02 AM   #204
shourya
Little Clucker
 
Join Date: Jun 2014
Location: india
Posts: 34
Reputation: 11
Default Re: Discord Connector

PHP Code:
CMake Error at libs/cmake/AddSAMPPlugin.cmake:(add_library):
  
Target "discord-connector" links to target "OpenSSL::SSL" but the target
  was not found
.  Perhaps a find_package() call is missing for an IMPORTED
  target
, or an ALIAS target is missing?
Call Stack (most recent call first):
  
src/CMakeLists.txt:23 (add_samp_plugin)


CMake Error at libs/cmake/AddSAMPPlugin.cmake:(add_library):
  
Target "discord-connector" links to target "Boost::system" but the target
  was not found
.  Perhaps a find_package() call is missing for an IMPORTED
  target
, or an ALIAS target is missing?
Call Stack (most recent call first):
  
src/CMakeLists.txt:23 (add_samp_plugin
ubuntu 14.04lts
__________________
shourya is offline   Reply With Quote
Old 09/07/2018, 11:44 AM   #205
Dayrion
High-roller
 
Dayrion's Avatar
 
Join Date: Jan 2016
Location: France
Posts: 1,915
Reputation: 256
Default Re: Discord Connector

Quote:
Originally Posted by iSpark View Post
I'm getting the same. And DCC_GetUserEmail returns a null string. Even though the DCC_User related to it has a valid string. Any help would be appreciated.
Your bot required OAuth2 Scope to provide users's mail and if they are verified.
You should read this: https://discordapp.com/developers/docs/topics/oauth2
__________________
actor_plus - v5.0.2
« I'm a goner, somebody catch my breath,
I'm a goner, somebody catch my breath »
Dayrion is offline   Reply With Quote
Old 17/07/2018, 04:50 AM   #206
Tass007
Gangsta
 
Tass007's Avatar
 
Join Date: May 2011
Location: Somewhere not near you
Posts: 731
Reputation: 31
Default Re: Discord Connector

Hi, I'm trying to use MySQL r41-4 and this plugin. However if I use the discord connect log-core.so file I get

Code:
Loading plugin: mysql.so
[00:43:08]   Failed (/usr/lib32/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /home/ogp_agent/eg/samp/plugins/../log-core.so))
If I use the MySQL log-core.so I get

Code:
Failed (libssl.so.1.1: cannot open shared object file: No such file or directory)
I am using Ubuntu
__________________
Copyright © 2016 vR Studios
Currently working with vR Studios
Copying and pasting doesn't allow you to learn the things that reading and understanding will.
Tass007 is offline   Reply With Quote
Old 17/07/2018, 07:04 PM   #207
Dayrion
High-roller
 
Dayrion's Avatar
 
Join Date: Jan 2016
Location: France
Posts: 1,915
Reputation: 256
Default Re: Discord Connector

Quote:
Originally Posted by Tass007 View Post
Hi, I'm trying to use MySQL r41-4 and this plugin. However if I use the discord connect log-core.so file I get

Code:
Loading plugin: mysql.so
[00:43:08]   Failed (/usr/lib32/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /home/ogp_agent/eg/samp/plugins/../log-core.so))
If I use the MySQL log-core.so I get

Code:
Failed (libssl.so.1.1: cannot open shared object file: No such file or directory)
I am using Ubuntu


Also, for the flooding error logs ; it will be solved in the next updated according to what maddinat0r wrote.
__________________
actor_plus - v5.0.2
« I'm a goner, somebody catch my breath,
I'm a goner, somebody catch my breath »
Dayrion is offline   Reply With Quote
Old 25/07/2018, 12:41 AM   #208
Xadr
Little Clucker
 
Join Date: Jul 2018
Posts: 7
Reputation: 0
Default Re: Discord Connector

Code:
public DCC_OnChannelMessage(DCC_Channel:channel, DCC_User:author, const message[])
{
	new channel_name[100 + 1];
	if(!DCC_GetChannelName(channel, channel_name))
		return 0;

	new user_name[32 + 1];
	if (!DCC_GetUserName(author, user_name))
		return 0;

    if(channel != BotChannel) return 0;
	new str[145];
	format(str, sizeof str, "{667aca}[Discord/%s] %s:{ffffff} %s", channel_name, user_name, message);
    for(new i = 0; i < MAX_PLAYERS; i++) {
    if (DiscordStats[i]==0) continue;
    SendClientMessage(i, -1, str); }

    return 1;
}
Code:
CMD:dchat(playerid, params[])
{
	new tmp[512], name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, MAX_PLAYER_NAME);
	if (Spawned[playerid] == 0) return SendClientMessage(playerid, COLOR_WHITE, "Server: You must be spawned to use this command!");
	if (DiscordStats[playerid]==0) return SendClientMessage(playerid, COLOR_WHITE, "Server: Turn on Discord Chat using /dchaton.");
	if (sscanf(params, "s[512]", tmp)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /dchat [message]");
	SendDC(CHANNEL_ID, "[chat]%s: %s ", name, tmp);
	return 1;
}
Whenever I use /dchat, it successfully transfers the message to the Discord channel but it also shows the bot's message in-game.


Basically; let's say you head into Discord and type something in the channel that's connected to the server. It will send your message to the in-game chat. Whenever you go in-game and send a message to the discord channel that's connected to the server, it will bring the bot's message back to you.

[Discord/samp] rg-bot: [chat]Xadr: yo


I already tried the given fixes but they only bring me errors.
Xadr is offline   Reply With Quote
Old 25/07/2018, 01:00 AM   #209
Dayrion
High-roller
 
Dayrion's Avatar
 
Join Date: Jan 2016
Location: France
Posts: 1,915
Reputation: 256
Default Re: Discord Connector

Quote:
Originally Posted by Xadr View Post
Code:
public DCC_OnChannelMessage(DCC_Channel:channel, DCC_User:author, const message[])
{
	new channel_name[100 + 1];
	if(!DCC_GetChannelName(channel, channel_name))
		return 0;

	new user_name[32 + 1];
	if (!DCC_GetUserName(author, user_name))
		return 0;

    if(channel != BotChannel) return 0;
	new str[145];
	format(str, sizeof str, "{667aca}[Discord/%s] %s:{ffffff} %s", channel_name, user_name, message);
    for(new i = 0; i < MAX_PLAYERS; i++) {
    if (DiscordStats[i]==0) continue;
    SendClientMessage(i, -1, str); }

    return 1;
}
Code:
CMD:dchat(playerid, params[])
{
	new tmp[512], name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, MAX_PLAYER_NAME);
	if (Spawned[playerid] == 0) return SendClientMessage(playerid, COLOR_WHITE, "Server: You must be spawned to use this command!");
	if (DiscordStats[playerid]==0) return SendClientMessage(playerid, COLOR_WHITE, "Server: Turn on Discord Chat using /dchaton.");
	if (sscanf(params, "s[512]", tmp)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /dchat [message]");
	SendDC(CHANNEL_ID, "[chat]%s: %s ", name, tmp);
	return 1;
}
Whenever I use /dchat, it successfully transfers the message to the Discord channel but it also shows the bot's message in-game.


Basically; let's say you head into Discord and type something in the channel that's connected to the server. It will send your message to the in-game chat. Whenever you go in-game and send a message to the discord channel that's connected to the server, it will bring the bot's message back to you.

[Discord/samp] rg-bot: [chat]Xadr: yo


I already tried the given fixes but they only bring me errors.
Check if the player who's talking in your discord's channel isn't a bot
PHP Code:
native DCC_IsUserBot(DCC_User:user, &bool:is_bot); 
If it's not, then send the message to all players of your server.
__________________
actor_plus - v5.0.2
« I'm a goner, somebody catch my breath,
I'm a goner, somebody catch my breath »
Dayrion is offline   Reply With Quote
Old 25/07/2018, 01:08 AM   #210
Xadr
Little Clucker
 
Join Date: Jul 2018
Posts: 7
Reputation: 0
Default Re: Discord Connector

Quote:
Originally Posted by Dayrion View Post
Check if the player who's talking in your discord's channel isn't a bot
PHP Code:
native DCC_IsUserBot(DCC_User:user, &bool:is_bot); 
If it's not, then send the message to all players of your server.
Thanks for your help. I just started scripting so please don't blame me, haha.

Uhh, I get these errors when inserting your code here:

Code:
public DCC_OnChannelMessage(DCC_Channel:channel, DCC_User:author, const message[])
{
	new channel_name[100 + 1];
	if(!DCC_GetChannelName(channel, channel_name))
		return 0;

	new user_name[32 + 1];
	if (!DCC_GetUserName(author, user_name))
		return 0;

    if(channel != BotChannel) return 0;
	new str[145];
	format(str, sizeof str, "{667aca}[Discord/%s] %s:{ffffff} %s", channel_name, user_name, message);
    for(new i = 0; i < MAX_PLAYERS; i++) {
    if (DiscordStats[i]==0) continue;
   >>>> native DCC_IsUserBot(DCC_User:user, &bool:is_bot); <<<<<
    SendClientMessage(i, -1, str); }

    return 1;
}
Code:
C:\Users\Xadr\Desktop\RDM-master\filterscripts\discord.pwn(85) : error 029: invalid expression, assumed zero
C:\Users\Xadr\Desktop\RDM-master\filterscripts\discord.pwn(85) : error 017: undefined symbol "user"
C:\Users\Xadr\Desktop\RDM-master\filterscripts\discord.pwn(85) : warning 221: label name "bool" shadows tag name
C:\Users\Xadr\Desktop\RDM-master\filterscripts\discord.pwn(85) : error 017: undefined symbol "is_bot"
C:\Users\Xadr\Desktop\RDM-master\filterscripts\discord.pwn(85) : fatal error 107: too many error messages on one line
Xadr is offline   Reply With Quote
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Plugin] Teamspeak Connector maddinat0r Plugin Development 325 08/09/2018 07:04 PM
Route Connector James_Braga Русский/Russian 9 15/05/2015 08:24 AM
[Map] Connector Gas Tellken Maps 4 01/06/2012 03:04 AM
PSU connector help! patchkinson Everything and Nothing 3 20/03/2010 09:24 PM


All times are GMT. The time now is 01:57 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.