A bot created with Python that interacts with GroupMe

Overview

GroupMe_Bot

This is a bot I'm working on a small groupme group I'm in. This is something I'll work on in my spare time. Nothing but just a fun little side project for when I'm bored.

Libraries used

Groupy: an API wrapper for Groupme

python-atomicwrites: Powerful Python library for atomic file writes

google-api-python-client (only needed if you will be doing yt searches from the bot)

Documentation for Groupy

Instructions

Before the bot can listen to a group, it needs to be added to that group. Do that first or the bot won't work.

There are two ways to run the bot.

  1. python3 start.py
  2. Docker

Make sure to change the information in main.py to what you want such as the location of your groupme key or youtube key.

You have to pick a deliminator to use this bot. The default one is $. You can change it by passing it to the bot object

Config and Credentials

The bot looks for Credentials in config.ini that is at the root of the repo. An example file has been provided.

Here you can modify some other settings such as the delimeter used, how often the bot will look for messages, and how often the bot will refresh the names and members of the group.

Groups

On first start (assuming a groups.json doesn't exist), the bot will prompt you to select what groups to listen to. It will create a groups.json where the key is the group name and the value will be a dictionary with an id and enabled keys. If enabled is set to true, it will listen to that chat. id is the group id and since it will use that to find the group, the group name can change but the bot will still be able to listen to it. If you are running this from docker, it is best to use the docker command below but with -it first instead of -ditv

JSON structure of groups.json

{
  "group1": {"enabled": true, "id": "1000123123"},
  "group2": {"enabled": false, "id": "834234235"}
}

Docker

Using the provided Dockerfile, you can build an image with docker build -t groupme-bot .

If you don't mount a volume to the container, any tags that are made will be lost once the container is stopped.

If you don't mount a volume that contains groupme.key to /app/creds, you need to pass it in as an environmental variable

Once the image is built, you can run it with:

docker run -ditv --rm -v [local tag folder]:/app/tags -v [local creds folder]:/app/creds -v [local groups.json]:/home/groupme/app/groups.json --name groupme groupme-bot

add -m [amount] or --cpus=[number] to limit the ram or CPU cores the container can use

To attach to a detached container, follow these steps (assuming you ran it with the -it arguments):

docker ps to find the Container ID

docker attach [Container ID] to attach to it

docker stop [Container ID] to stop the container

Ctrl-C to shutdown the container

Ctrl-p Ctrl-q to detach from it

Commands

Everything command should lead with the delimiter (the default delimiter is "$")

command argument(s) example
avatar [mention_name] avatar @name
git none git
yt** [query] yt skateboard tricks

** yt command will only post the first link from the youtube search

Tag System

command argument(s) example
create [tag_name] [stuff]** tag create cooltag this is a cool tag
edit [tag_name] [stuff]** tag edit cooltag this is a new edit
delete [tag_name] tag delete cooltag
none [tag_name] tag cooltag
list none tag list
owner [tag_name] tag owner cooltag
gift [tag_name] @mention tag gift cooltag @new_owner
rename [tag_name] [new tag_name] tag rename cooltag coolertag
help none tag help

** [stuff] can be a string, a link to anything, or an image that is upload through groupme

** If [stuff] is an image uploaded through groupme, then the description with the image should just be:

tag create [tag_name]

The commands create, edit, delete, gift, and rename can only be down by the owner of the tag. The owner is whoever created the tag.

owner command will get the user_id of the owner and will find attempt to match it to the nickname of the owner.

JSON structure

This is the json structure of tags

{
 "id": "group id goes here",
 "name": "group name goes here",
 "tags": {
   "tag1": {
     "content": "tag1 content",
     "owner": "owner id"
   },
   "tag2": {
     "content": "tag2 content",
     "owner": "owner id"
   }
 }
}
Owner
20 something year old guy who is into anything tech related
Telegram Bot for saving and sharing personal and group notes

EZ Notes Bot (ezNotesBot) Telegram Bot for saving and sharing personal and group notes. Usage Personal notes: reply to any message in PM to save it as

Dash Eclipse 8 Nov 07, 2022
Make low level API wrapper in fast, easy.

The lowrapper is a library for quickly and easily creating an environment for tapping the API without implementation.

tasuren 1 Oct 25, 2022
🚧 finCLI's own News API. No more limited API calls. Unlimited credible and latest information on BTC, Ethereum, Indian and Global Finance.

🚧 finCLI's own News API. No more limited API calls. Unlimited credible and latest information on BTC, Ethereum, Indian and Global Finance.

finCLI 5 Jun 16, 2022
Asynchronous Guilded API wrapper for Python

Welcome to guilded.py, a discord.py-esque asynchronous Python wrapper for the Guilded API. If you know discord.py, you know guilded.py. Documentation

shay 115 Dec 30, 2022
⭐️ Pyro String Generator ⭐️ Genrate String Session Using this bot.Made by TeamUltronX 🔥

⭐️ Pyro String Generator ⭐️ Genrate String Session Using this bot.Made by TeamUltronX 🔥 Configs: API_HASH Get from Here. API_ID Get from Here. API_KE

TheUltronX 2 Dec 16, 2022
A discord bot consuming Notion API to add, retrieve data to Notion databases.

Notion-DiscordBot A discord bot consuming Notion API to add and retrieve data from Notion databases. Instructions to use the bot: Pre-Requisites: a)In

Servatom 57 Dec 29, 2022
Most Advance Trading Bot Support Windows Linux Mac

GUI Pancakeswap 2 and Uniswap 3 SNIPER BOT 🏆 🥇 (MOST ADVANCE TRADING BOT SUPPORT WINDOWS LINUX MAC) (AUTO BUY TOKEN ON LAUNCH AFTER ADD LIQUIDITY) S

1 Dec 26, 2021
Python SDK for 42DI

42di Python SDK Install pip install git+https://github.com/42di/python-sdk import import di #42di import pandas_datareader as pdr Init SDK project =

42DI 2 Nov 03, 2021
Python wrapper for the Intercom API.

python-intercom Not officially supported Please note that this is NOT an official Intercom SDK. The third party that maintained it reached out to us t

Intercom 215 Dec 22, 2022
AWS Auto Inventory allows you to quickly and easily generate inventory reports of your AWS resources.

Photo by Denny Müller on Unsplash AWS Automated Inventory ( aws-auto-inventory ) Automates creation of detailed inventories from AWS resources. Table

AWS Samples 123 Dec 26, 2022
Um simples bot público para todos usarem no discord!

Discord Bot - Código Público Características: Linguagem de Programação: Python Quantidade de comandos: 17 Comandos: Prefixo do bot: O prefixo desse bo

Kevin 3 Dec 31, 2021
A simple chat api that can also work with ipb4 and chatbox+

SimpleChatApi API for chatting that can work on its own or work with Invision Community and Chatbox+. You are also welcome to create frontend for this

Anubhav K. 1 Feb 01, 2022
A Telegram bot to all media and documents files to web link .

FileStreamBot A Telegram bot to all media and documents files to web link . Report a Bug | Request Feature 🍁 About This Bot : This bot will give you

Code X Mania 129 Jan 03, 2023
自用直播源集合,附带检测与分类功能。

myiptv 自用直播源集合,附带检测与分类功能。 为啥搞 TLDR: 太闲了。 自己有收集直播源的爱好,和录制直播源的需求。 一些软件自带的直播源太过难用。 网上现有的直播源太杂,且缺乏检测。 一些大源缺乏持续更新,如 iptv-org。 使用指南与 TODO 每次进行大更新后都会进行一次 rel

abc1763613206 171 Dec 11, 2022
A customizable, multilanguage Telegram shop bot with Telegram Payments support

Greed A customizable, multilanguage Telegram shop bot with Telegram Payments support! Demo Send a message to @greedtestbot on Telegram to view a demo

Stefano Pigozzi 328 Dec 29, 2022
This repo provides the source code for "Cross-Domain Adaptive Teacher for Object Detection".

Cross-Domain Adaptive Teacher for Object Detection This is the PyTorch implementation of our paper: Cross-Domain Adaptive Teacher for Object Detection

Meta Research 91 Dec 12, 2022
A simple bot which using an API , detects reported discord scams and kicks the user if possible while deleting the message

A simple bot which using an API , detects reported discord scams and kicks the user if possible while deleting the message

Vioshim 3 Nov 16, 2022
um simples script para localizar IP

um simples script para localizar IP pkg install git (apt-get install git) pkg install python (apt-get install python) git clone https://github.com/byd

bydeathlxncer 4 Nov 29, 2021
Instagram boosting

instagram boosting bot This bot can boost your instagram account! Rules and Instruction Use git clone to download this repository Open cmd/terminal an

Eskimo 4 Oct 20, 2022
SSH-Restricted deploys an SSH compliance rule (AWS Config) with auto-remediation via AWS Lambda if SSH access is public.

SSH-Restricted SSH-Restricted deploys an SSH compliance rule with auto-remediation via AWS Lambda if SSH access is public. SSH-Auto-Restricted checks

Adrian Hornsby 30 Nov 08, 2022