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"
   }
 }
}
You might also like...
A Discord Bot created using Pycord!

Hey, I am Slash Bot. A Bot which works with Slash Commands! Prerequisites Python 3+ Check out. the requirements.txt and install all the pakages. Insta

A Slash Commands Discord Bot created using Pycord!

Hey, I am Slash Bot. A Bot which works with Slash Commands! Prerequisites Python 3+ Check out. the requirements.txt and install all the pakages. Insta

This Telegram bot is created to help monitor individual mood. Lean and mean

Mood bot This bot is created to help monitor your mood. Lean and mean. Deployment Install Docker and Docker Compose Populate .env file cp .env.dist .e

A simple Discord Bot created for basic functionality and fun chat commands for use in a private server.

LoveAndChaos-Bot v0.1.0 LoveAndChaos-Bot is a Discord Bot specifically designed for a private server; this bot is merely a test and a method to expose

Some random bot for Discord which was created just for fun (Made with Discord.py library)
Some random bot for Discord which was created just for fun (Made with Discord.py library)

Ghosty Previously known as 'secondthunder-py-bot' This is repository of some random bot for Discord which was created just for fun and for some educat

Bagas Mirror&Leech Bot is a multipurpose Telegram Bot written in Python for mirroring files on the Internet to our beloved Google Drive. Based on python-aria-mirror-bot
Bagas Mirror&Leech Bot is a multipurpose Telegram Bot written in Python for mirroring files on the Internet to our beloved Google Drive. Based on python-aria-mirror-bot

- [ MAYBE UPDATE & ADD MORE MODULE ] Bagas Mirror&Leech Bot Bagas Mirror&Leech Bot is a multipurpose Telegram Bot written in Python for mirroring file

A discord Server Bot made with Python, This bot helps people feel better by inspiring them with motivational quotes or by responding with a great message, also the users of the server can create custom messages by telling the bot with Commands.
A discord Server Bot made with Python, This bot helps people feel better by inspiring them with motivational quotes or by responding with a great message, also the users of the server can create custom messages by telling the bot with Commands.

A discord Server Bot made with Python, This bot helps people feel better by inspiring them with motivational quotes or by responding with a great message, also the users of the server can create custom messages by telling the bot with Commands.

Aqui está disponível GRATUITAMENTE, um bot de discord feito em python, saiba que, terá que criar seu bot como aplicação, e utilizar seu próprio token, e lembrando, é um bot básico, não se utiliza Cogs nem slash commands nele!

BotDiscordPython Aqui está disponível GRATUITAMENTE, um bot de discord feito em python, saiba que, terá que criar seu bot como aplicação, e utilizar s

(@Tablada32BOT is my bot in twitter) This is a simple bot, its main and only function is to reply to tweets where they mention their bot with their @

Remember If you are going to host your twitter bot on a page where they can read your code, I recommend that you create an .env file and put your twit

Owner
20 something year old guy who is into anything tech related
null
Discord ToolBox is a discord bot developed by DJD320 created for the purpose of having some convenient tools in the form of a single bot.

Discord ToolBox Discord ToolBox is a discord bot developed by DJD320 created for the purpose of having some convenient tools in the form of a single b

null 3 Aug 7, 2021
Pincer-bot-template - A template for a Discord bot created using the Pincer library

Pincer Discord Bot Template (Python) WARNING: Pincer is still in its alpha/plann

binds 2 Mar 17, 2022
Automate TikTok follower bot, like bot, share bot, view bot and more using selenium

Zefoy TikTok Automator Automate TikTok follower bot, like bot, share bot, view bot and more using selenium. Click here to report bugs. Usage Download

null 555 Dec 30, 2022
Robocord is a bot created for the Pycord community.

Robocord is a bot created for the community of the Pycord Server. Just a bot created for Pycord Server. You can start pull requests, I will check it and if its good I will add it to the bot. ??

Bruce 7 Jun 26, 2022
The public discord bot, created by: primitt, further developed by: duino-coin team.

Duino Stats Mini A public Duino-Stats Discord bot. Click this link to invite the bot to your server. License Duino Stats Mini distributed under the MI

primboi 8 Mar 14, 2022
This bot is created by AJTimePyro and It accepts direct downloading url & then return file as telegram file.

URL Uploader Bot This is the source code of URL Uploader Bot. And the developer of this bot is AJTimePyro, His Telegram Channel & Group. You can use t

Abhijeet 23 Nov 13, 2022
Discord bot for name verifying. Created for TinkerHubGCEK discord server. Tinky is now deployed in heroku

Custom Discord bot This custom discord-python bot assigns roles to members joined at discord server. It looks and compares a list before verifying the

Edwin Jose George 2 Dec 16, 2021
unofficial source of the discord bot, “haunting.” created by: vorqz, vert, & Veltz

hauntingSRC unofficial source of the discord bot, “haunting.” created by: vorqz, vert, & Veltz reasoning: creators skidded the most of this bot and do

Vast 11 Nov 4, 2022
The best Discord bot, created for r/Jailbreak

Bloo Setup instructions These instructions assume you are on macOS or Linux. Windows users, good luck. With Docker (recommended!) You will need the fo

GIR 33 Dec 16, 2022
Editing a Tinder bot created by @frederikme

tinder_bot_edit Editing a Tinder bot created by @frederikme Table of Contents Basic Swipe Bot Basic Swipe Bot Download the code as a zip or clone the

Alex Carter 1 Nov 23, 2021