Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Extra libraries, Code snippets, applications etc. » Applications created with U++ » Bot library for discord, bombs example adapted.
Re: Bot library for discord, bombs example adapted. [message #52668 is a reply to message #49999] Fri, 08 November 2019 13:39 Go to previous messageGo to previous message
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
Hello JjacksonRIAB,

I face a problem with your lib, when I use it on Linux it crash after few hours of running.

here is the crash message :
https://i.imgur.com/TWcAIOK.png

last line : "Erreur de segmentation" mean "segmentation error"

The code I use to produce this error is really simple :
#include <Core/Core.h>
#include "Discord.h"
using namespace Upp;

CONSOLE_APP_MAIN
{
	
	Discord bot(<botID>, <botToken>);
    
    bot.WhenMessageCreated = [&](ValueMap payload) {
        String channel  = payload["d"]["channel_id"];
        String content  = payload["d"]["content"];
        String userName = payload["d"]["username"];
        
        if(content.StartsWith("!hello")) {
            bot.CreateMessage(channel, "hello, world!");
        }
    };
    
    bot.Listen();
}


Have you any idea of how to fix this ?

Thanks in advance.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: U++ SSH package and Turtle in action (Videos)
Next Topic: UltimateOpenGL [BETA] 3D engine
Goto Forum:
  


Current Time: Mon Sep 01 01:27:42 CEST 2025

Total time taken to generate the page: 0.00740 seconds