GithubHelp home page GithubHelp logo

smith8h / sreporter-flutter Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 325 KB

SReporter library, send reports, crash logs, notifications and more messages from your app to your Telegram group or/and Discord server.

License: Apache License 2.0

Kotlin 0.58% Dart 99.42%

sreporter-flutter's Introduction

SReporter

Builds and tests pub package pub points Latest release Stable Version Stability repo size

A helpful dart package to send reports, crash logs and messages from your app to telegram chat (private, group or channel) using telegram bot. or to discored server to specific channel using server webhook.

Usage

To use this plugin, add SReporter as a dependency in your pubspec.yaml file.

dependencies:
  sreporter: ^1.0.0

Example

Import the library.

import 'package:sreporter/sreporter.dart';

Use it anywhere you want to create a Telegram or Discord reports:

Telegram Report

Preview

tele preview

How to use

Telegram report supports markdown elements within its header ande content. Use:

    TeleCode('// Code...', lang: 'java').toString(); // lang is optional
    TeleUnderline(' text ').toString();
    TeleSpoiler(' text ').toString();
    TeleStrikeThrough(' text ').toString();
    TeleItalics(' text ').toString();
    TeleBold(' text ').toString();

Whole Code:

    SReporter.teleReporter(
      botToken: '195211143...', // get it from @botFather in Telegram
      targetChat: '14888...', // ID or mention username '@smith8h'
      reportHeader: 'Report sent from ${Italic('Demo App')}.',
      reportSubHeader: '${Spoiler(Underline('Flutter-Demo').toString())}', // optional
      reportMessage: '${Code('Custom.message', lang: 'dart')}',
      reportFooter: 'Footer (More Info)...', // optional
      onSuccess: () {
        // on success to send the report
      },
      onFailure: (msg) {
        // on failed to send the report
      },
    ).report();

Discord Report

Preview

disc preview

How to use

Discord report supports markdown elements within its header ande content. Use:

    DiscCode('// Code...', multiline: true).toString(); // multiline is false by default.
    DiscUnderline(' text ').toString();
    DiscSpoiler(' text ').toString();
    DiscStrikeThrough(' text ').toString();
    DiscItalics(' text ').toString();
    DiscBold(' text ').toString();
    DiscHeader(' text ', type: 1).toString(); // type represents header degree h1, h2, h3...
    DiscLink('text', 'url').toString();
    DiscListItem('text', indent: true).toString(); // indent to make the list item belongs to secondary list.
    DiscBlockQuote('text', wholeMsg: true).toString(); // wholeMsg to set the block qoute to single line or whole message.

Whole Code:

    SReporter.discReporter(
      webhook: 'https://discord.com/api/webhooks/11...',
      contentMessage: 'Content Message with ${DiscBold('spoiler text')}...',
      onSucess: () {
        // on success to send the report
      },
      onFailure: (failMsg) {
        // on failed to send the report
        // use fail message.
      },
    ).report();

sreporter-flutter's People

Contributors

smith8h avatar

Stargazers

 avatar

Watchers

 avatar

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.