Anope IRC Services
Anope Development => Modules => Topic started by: lavinpj1 on April 18, 2006, 07:51:51 PM
-
I am very new to module coding so please bare with me. Is it possible to find out if a particular user is the founder of a channel? This will then enable me to only allow channel founders to use the command.
Thanks in advance
Phil
-
here s the syntax t check...
User *u
ChannelInfo *ci
is_real_founder(u, ci) // 1 for superadmin or chanserv founder
is_founder(u, ci) // 1 for superadmins or any1 who is identified with cs pass
both return ints..
next time you might wanna check the anope doxy though ... nothing you need to know that you can't find in there
edit: http://anope.zero.org/doxy/extern_8h.html (takes a long time to load - only a few of these in the doxy though) or just plain http://anope.zero.org
[Edited on 18-4-2006 by Viper]
-
Hrmmm, thanks for that. One thing I don't understand is where the ChannelInfo *ci gets the channel name from. How can I assign that variable to the channel info of the contents of another variable.
e.g. I have a variable named channel which is taken from the command entered by the user, /os servjoin #channel, and this is what I want to use to check for founder staus in.
Sorry if i'm slow here.
Thanks
Phil
-
if ya have a char *chan where chan is the channelname then
ChannelInfo *ci = cs_findchan(chan);
Channel *c = findchan(chan);
things like this can be easily extracted from allready existing modules though ..
just go over the code of a few modules and ya ll learn a lot :-)
edit: you can put if structures around the ci = cs_findchan(chan) to check whether the chan is registered or actually exists
once again a lot of info regarding these functions can be found in the doxy
[Edited on 18-4-2006 by Viper]
[Edited on 18-4-2006 by Viper]