Git Product home page Git Product logo

pklempe / sam Goto Github PK

View Code? Open in Web Editor NEW
26.0 26.0 6.0 570 KB

SAM is a multi-functional Discord Bot specifically designed for the Server of the Faculty of Computer Science at the University of Vienna.

License: GNU General Public License v3.0

Makefile 0.02% Python 99.98%
computer-science discord discord-bot discord-py discordapp discordbot discordpy python python3 university universityofvienna vienna

sam's Introduction

Profile Banner Image


About Me

  • ๐Ÿšž I'm a Computer Science student and Software Developer from Austria.
  • ๐Ÿ’ผ I'm currently working at twinformatics.
  • ๐ŸŽฎ I have a passion for gaming, especially unique Indie games.
  • ๐Ÿฟ I love movies and going to the cinema.
  • ๐Ÿ‹๏ธโ€โ™‚๏ธ I like to work out in my spare time.
  • ๐Ÿ“ซ Ask me anything on my discussions page.

My GitHub Stats

PKlempe's Profile View Counter
PKlempe's GitHub Stats PKlempe's Most Used Languages


If you like my work,

Show some โค๏ธ by starring the repositories!

sam's People

Contributors

abbcccddddeeeeeffffff avatar azratosh avatar dependabot[bot] avatar katakompe avatar pklempe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sam's Issues

Improve log message formatting

Current log message format:
INFO 2020-08-20 15:29:01,642: Command ping called by PKlempe#0001 in channel bot-testing

Suggested changes for better readability:
INFO 2020-08-20 15:29:01,642: Command "ping" called by PKlempe#0001 in channel [#bot-testing]

About command

Implement a command which makes the bot post an embeded message containing some information (and maybe some stats) about itself and a link to the GitHub repository.

Command for scheduling messages

A command which makes SAM post a message at a specified time. To be more specific, the server owner should be able to specify a message which gets automatically posted by SAM in a specified channel at a specfied time.

For example: Lets say we want SAM to wish everyone on the server "Merry Christmas" on the 24th of December. This could be done by posting a message in the news channel but we don't want to constantly remind ourselves to write it. That's why it would be a good idea to schedule one and SAM does the rest.

Moderation commands

A collection of commands which let the moderators do their job.

Possible commands for punishments:

  • warn
  • kick
  • ban
  • mute
  • setnick (changes nickname on server)
  • purge (messages)
  • lock (locks a channel by changing its permissions)

Possible commands for information gathering:

  • newusers
  • notes
  • avatar (shows a users avatar)
  • info (get some info about a user)
  • nicknames (nickname history of a user)

Special version of these commands (e.g.: tempmute, clear warns) or other useful extensions haven't been explicitly mentioned here.

Possibility to submit suggestions and other commands for moderators to mark them as "approved", "denied", etc

A command which lets users submit suggestions which will then be posted in a specific channels for people to vote on. Voting happens via two reactions. If enough up- or downvotes have been made and the difference between them is kinda significant, the embed of the suggestion should change its color. This signals if the idea is popular or not.

Some other commands for moderators to mark suggestions as "approved", "denied", "considered" or "implemented".

Command for adding one or multiple course roles to yourself

A command which lets user add course roles to themselve so that they can unlock channels for specific courses on their own.

e.g. !add mg1 which would add the server role called "MG1" to a user.

Of course this shouldn't be possible for server roles with higher permissions like "Moderator" for example.

Command for reporting a user to the moderators

In the case that someone breaks the server rules, users should be able to report specific persons to the moderators. This could be done via a command like !report [User] where you should be able to simply write a users nickname instead of direlcty mentioning him. The second could trigger a notification which will then be sent to the offender, which results in him/her knowing, who informed the moderators.

To inform the moderators, an embed will be posted in a configured report channel on the server.

"RemindMe" command

A command which reminds a user about something after a specified time is over.

Serverinfo command

A command which shows some interesting stats about our server like amount of users, channels, etc.

Purge command for deleting the last x messages

A command which lets moderators remove the last x messages in a channel. The command should have a hard coded limit of 100 messages and can only be used in the channel in which it has been invoked (no channel mentions possible).

Create and design database for stateful configuration

We will need a database access for many operations which require configuration, like commands that should make the bot do something in a special channel or let the bot send a specific message repeatedly. Things like the message or the channel for the specific command need to be persisted so the bot wont forget them once configured.

This issue is only about creating a database with a fitting (and extendable) design for this and creating code to access it correctly.

Command for changing the bots Discord presence

A command which let's the server admin change the bots presence on Discord. The presence consists of the following:

  • activity: The activity being done.
  • status: The online status.
  • afk: Indicator if you are AFK.

Modmail command

A command which lets users write a message to all the mods. This could be achieved by posting them in a specified channel in the hidden category for moderators.

File persistence

We need a way to save and provide uploaded files to discord.

Main challenges :
-save space
-only upload files that are relevant
-get metainformation about the files without too much hassle for the user providing
-provide in a easily searchable way

Ideas:
-Compress files after uploading
-Add reactions to each file posted. If the author (or a mod) clicks the reaction, the file will be added to the corresponding category
-Enforce a naming scheme that provides information (ideas?)
-Command for search where bot lists available files to user based on search and sends the selected to him (all in DM)

Ping command

Implement a command which returns the current ping in milliseconds.

Commands for loading, unloading or reloading a Cog

The command should be inside the Admin Cog and can therefore only be invoked by the server owner.

This way we can deactivate specific kinds of commands or introduce new ones without taking the bot offline. Once the extension reloads, any changes that we did will be applied.

Trakt.tv integration

Trakt.tv integration for getting information about movies, series and newly released stuff.

Command for showing all the nicknames a user had on this server

When a user changes his nickname, the old one should be stored in our database. This way we can implement a command which shows us all the different names a user had on our server so that moderators always know who is who and people cannot simply change their name to hide from them.

Command for reporting bugs

Add a command that allows users to report bugs or feedback directly related to the bot and its implementation (the bot could eventually even create a github issue)

Embed layout for open/assigned modmail tickets doesn't work on mobile

The current layout used for the embed listing all currently opne/assigned modmail tickets isn't mobile friendly. Inline embed fields will simply be put beneath each other which results in all timestamps being under the actual tickets. This makes it hard to see which timestamp belongs to which ticket.

Command for posting a simple message

A command which makes the bot post a message. If a channel has been specified, the bot should post the message there and if not, it should post it in the current channel where the command has been invoked.

Command call logging

Functionality to log calls to the commands.
Logs which command was when called by which user in which channel.
Possibility to log to console and to file.

Add Actions for Build

We need a Github Action that performs our build process each time a Pull Request is created to master.

The build process should consist of at least:

  1. Running pylint on the code
  2. Running mypy on the code
  3. Running pytest to run all tests

All precoditions must be met (pip install requirements etc.)

Command for exchanging groups during the beginning of a semester

A dedicated text channel where users can exchange their assigned groups via a bot command. This could be combined with #41 so that only SAMs messages remain in the channel and therefore keeping it clear.

After a user has made an offer, an embeded message should be posted which contains every relevant information for an exchange (e.g. user, course, group, etc).
SAM should also be able to inform users via DM about possible exchange partners. Users should also be able to revoke their offer if they've successfully changed groups or simply changed their mind.

Command for disabling other commands

Title says it all. Could be useful if a command is being abused in some way and we have to act quickly. While it's disabled we have all the time we need to work on a solution.

Load hard coded channels in cog init instead of in command

Fixed channels (modmail, report, group_exchange,...) should be loaded when the bot starts in the init_function and held there as a class variable to be used.
This has several advantages:

Code is shorter and better to read:

await ctx.guild.get_channel(constants.CHANNEL_ID_REPORT).send(embed=embed)
#vs
await report_channel.send(embed=embed)

Probably speeds up the command minimally as no search (through all guilds) for the channel has to happen when the command is invoked.

Bot throws an Error immediately on startup if the channel id is invalid instead of on first command invokation.

Code Cleanup

Improve existing code by implementing #85, #94, moving server specific values into .env, improving message layouts and other miscellaneous stuff that will be found on the way.

Automod

Implement functionality so that the bot can independently detect Spam or other unwanted stuff and act accordingly by removing messages and punishing users.

Possible things the bot should look out for:

  • Spam
    • too many messages
    • too many attachments
    • too many mentions
    • too many links
  • Capslimit
  • Bad words
  • Bad links
  • Line break limit

Possible punishments:

  • Warnings
  • Tempmutes
  • Kick
  • Ban
  • Tempban

One could even implement punishment levels which get triggered by getting a specific amount of warnings.

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.