Futurism › class › dAmnAdminPacket
From Botdom Documentation
The dAmnAdminPacket class is used to handle the specific format found in the incoming dAmn recv admin packets. An incoming packet object is inputted, and it parses important parts and puts them as properties, and also formulates the admin packet in a human readable summary, found when the dAmnAdminPacket object instance is accessed as a string.
Contents |
Properties
- str act — The action being performed, always the first keyword.
- str type — The targeted type. (Is normally "privclass", "users" or "globalprivs".)
If act is "create" (we're creating a privclass):
- str by — Who created the privclass.
- str name — The name of the new privclass.
- str privs — The string of privs of the new privclass.
If act is "update" (we're updating a privclass or globalprivs):
- str by — Who updated the privclass.
- str name — If we're updating a privclass; the name of the new privclass.
- str privs — The string of privs which were updated.
If act is "rename" (we're renaming a privclass):
- str by — Who renamed the privclass.
- str name — The new privclass name.
- str prev — The previous privclass name.
If act is "move" (we're moving all users from one privclass to another):
- str affected — Number of users being moved (affected).
- str by — Who moved the users.
- str name — The name of the privclass users are being moved to.
- str prev — The name of the privclass users were previously in.
If act is "remove" (we're removing a privclass):
- str affected — Number of users in the removed privclass (being affected).
- str by — Who removed the privclass.
- str name — The name of the privclass being removed.
If act is "show" or "showverbose" (we're showing privclass/users statistics):
- If type is "users":
- dict users — A dictionary of all users in their respective privclasses.
- If type is "privclass":
- dict privs — A dictionary of privclasses and their respective privileges.
Initialization
__init__(instance pkt)
Takes the inputted dAmnPacketI packet object instance and parses the properties found above. Below is the example of properties in a create situation:
pkt = dAmnPacketI("recv chat:elec\n\nadmin create\np=privclass\nby=electricnet\nname=Cakefayse\nprivs=+smilies emotes=2") apkt = dAmnAdminPacket(pkt) # apkt.act is: create # apkt.by is: electricnet # apkt.name is: Cakefayse # apkt.privs is: +smilies emotes=2 # apkt.type is: privclass
String
When the dAmnAdminPacket object instance is accessed as a string, it is a human-readable summary of the admin packet.
s = str(apkt) # s is: privclass Cakefayse has been created by electricnet with: +smilies emotes=2

