-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[module] Admin module for group management #20
Comments
All right, I will get tmp = do_mute(thread, reply_text, &(const tga_restrict_cm_t){
.chat_id = tge_get_chat_id(evt),
.user_id = target_uid,
.until_date = 0,
.permissions = {
.can_send_messages = is_unmute,
.can_send_media_messages = is_unmute,
.can_send_polls = is_unmute,
.can_send_other_messages = is_unmute,
.can_add_web_page_previews = is_unmute,
.can_change_info = is_unmute,
.can_invite_users = is_unmute,
.can_pin_messages = is_unmute
}
}); So, parameter |
Yes
Yes, below is the explanation: |
Okay, then I'll work on |
@ALiwoto your work will be here GNUWeebBot/src/gwbot/modules/003_admin/admin.c Lines 553 to 567 in 2ba55c2
For example, in that case, if an admin send a message: Does that make sense to you? |
@ALiwoto for the baseline, you can submit a simple parser code to me. I will co-author your name and email in the commit. #include <stdio.h>
#include <stdint.h>
#include <time.h>
#include <inttypes.h>
int main(void)
{
const char *reason = "2d 1h"; // 2 days 1 hour
time_t unix_time = 0;
/*
*
* Do something with the `reason` and `unix_time`
*
*/
printf("unix_time = %" PRIu64, (uint64_t)unix_time); // should print 176400 (2 days 1 hours in second unit)
} |
Can you tell me what is I can see the GNUWeebBot/src/gwbot/modules/003_admin/admin.c Lines 40 to 53 in 2ba55c2
Can you explain it a bit? |
@ammarfaizi2 Where should I put that simple parser? |
@ALiwoto So, you see the enum, range from |
You may post the code here (on the issue comment). |
Okay, I'll attach it to the next comment. |
@ammarfaizi2 is delete message API related to this issue? |
@komori-k yes, the |
This bot needs to have group management features. So let's create it. In order to gets the bot working properly, the bot must be a group administrator with sufficient permissions.
Module Specification
!
or/
or.
or~
.!
, but you can use other prefixes mentioned above.Privileged commands
!ban
is a command for admin to ban a user (reply to user's message to be banned).!unban
is a command for admin to unban a user (reply to user's message to be unbanned).!kick
is a command for admin to kick a user (reply to user's message to be kicked). The difference with!ban
is that the kicked user is free to rejoin the group after they gets kicked. No unban action needs to be performed.!warn
is a command for admin to warn user (reply to user's message to be warned). The number of warnings will be stored in the bot database. When it reaches the maximum number, the warned user will be banned from the group.!mute
is a command for admin to mute user (reply to user's message to be muted).!tmute
is a command for admin to mute user temporarily. This command requires an argument. The argument is a number to determine how long the user is going to be muted. It can use suffixs
for second,m
for minute,d
for day,w
for week. By default, if suffix is not provided, then the unit will be second.!unmute
is a command for admin to unmute user (reply to user's message to be unmuted).!pin
is a command for admin to pin a message (reply to message to be pinned).!unpin
is a command for admin to unpin a message (reply to message to be unpinned).!del
or!delete
is a command for admin to delete a message (reply to message to be deleted).Normal user commands
!report
is a command for normal user to report an event to the admins. All admins will be notified via private message if they have started the bot.!delvote
is a command for normal user to vote a message deletion.Caveat: This document has not finished.
The text was updated successfully, but these errors were encountered: