Giter Site home page Giter Site logo

seymenbahtiyar / slack_channel_bot Goto Github PK

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

Slack_Channel_Bot is a C# console application that listens for messages in a specific Slack channel and responds to them based on certain keywords. It uses the RestSharp library for making API requests to the Slack API.

License: MIT License

C# 100.00%
slack slack-api slack-app slack-bot slackbot

slack_channel_bot's Introduction

Slack Channel Bot

Slack Channel Bot is a C# console application that listens for messages in a specific Slack channel and responds to them based on certain keywords. It uses the RestSharp library for making API requests to the Slack API.

Setup

  1. Create a new bot(app) in your Slack workspace and generate a bot token for it. And you must add the necessary bot scopes.
  2. Set the slackBotToken, slackChannelIDForListen, and slackBotUserID variables in the Program.cs file to the appropriate values for your Slack bot and channel.
  3. Run the application.

Usage

The SlackChannelBot listens for incoming messages in the specified Slack channel and responds to them based on certain keywords.

Available Commands

  • -help: Shows a list of available commands.

Example Usage

User: Hello!

Bot:

image

Methods

  • Main(string[] args): The entry point of the application. Initializes the application and starts listening for incoming messages.
  • GetLastMessage(): Retrieves the timestamp of the last message received in the specified Slack channel.
  • ListenForMessages(): Listens for incoming messages in the specified Slack channel and responds to them based on certain keywords.
  • SendMessage(string userId, string text): Sends a message to the specified user in the specified Slack channel.

Variables

  • slackBotToken: The bot token for authentication.
  • lastMessageTimestamp: A variable to store the timestamp of the last message received.
  • slackChannelIDForListen: The ID of the Slack channel where the bot will listen for incoming messages.
  • slackBotUserID: The ID of the Slack bot user.
  • slackBaseURL: The base URL for the Slack API.

License

MIT

slack_channel_bot's People

Contributors

seymenbahtiyar 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.